X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fstoresession.cpp;h=5eb6a8ad25aacbec2085500ad95a6ec9363a0ad1;hb=HEAD;hp=809dba3e6694e37da736e6799e2deaa946e69d18;hpb=56c4de9ada023505b16b6d188fb77d9fb10e52e1;p=pulseview.git diff --git a/pv/storesession.cpp b/pv/storesession.cpp index 809dba3e..5eb6a8ad 100644 --- a/pv/storesession.cpp +++ b/pv/storesession.cpp @@ -45,7 +45,6 @@ using std::mutex; using std::pair; using std::shared_ptr; using std::string; -using std::unordered_set; using std::vector; using Glib::VariantBase; @@ -185,6 +184,9 @@ bool StoreSession::start() {{ConfigKey::SAMPLERATE, Glib::Variant::create( any_segment->samplerate())}}); output_->receive(meta); + + auto header = context->create_header_packet(session_.get_acquisition_start_time()); + output_->receive(header); } catch (Error& error) { error_ = tr("Error while saving: ") + error.what(); return false; @@ -302,10 +304,14 @@ void StoreSession::store_proc(vector< shared_ptr > achannel_li units_stored_ = unit_count_ - (sample_count_ >> progress_scale); } - auto dfend = context->create_end_packet(); - const string ldata_str = output_->receive(dfend); - if (output_stream_.is_open()) - output_stream_ << ldata_str; + try { + auto dfend = context->create_end_packet(); + const string ldata_str = output_->receive(dfend); + if (output_stream_.is_open()) + output_stream_ << ldata_str; + } catch (Error& error) { + error_ = tr("Error while saving: ") + error.what(); + } // Zeroing the progress variables indicates completion units_stored_ = unit_count_ = 0;