]> sigrok.org Git - pulseview.git/commitdiff
StoreSession: Also send SR_DF_HEADER packet
authorSoeren Apel <redacted>
Sat, 8 Apr 2023 21:17:09 +0000 (23:17 +0200)
committerSoeren Apel <redacted>
Sat, 8 Apr 2023 21:17:39 +0000 (23:17 +0200)
Some output modules rely on it, e.g. CSV

pv/storesession.cpp

index 182642ee9aba08757269c43e208cf3b7147d5ef5..6d1a4ab96590391fdfada7a278a84262cef96123 100644 (file)
@@ -184,6 +184,12 @@ bool StoreSession::start()
                        {{ConfigKey::SAMPLERATE, Glib::Variant<guint64>::create(
                                any_segment->samplerate())}});
                output_->receive(meta);
+
+               Glib::TimeVal start_time;
+               start_time.tv_sec = 0;  // TODO Assumes saved data begins at t=0
+               start_time.tv_usec = 0;
+               auto header = context->create_header_packet(start_time);
+               output_->receive(header);
        } catch (Error& error) {
                error_ = tr("Error while saving: ") + error.what();
                return false;