From: Soeren Apel Date: Sat, 15 Aug 2015 21:14:17 +0000 (+0200) Subject: Fix #615 by opening the output stream only if needed X-Git-Tag: pulseview-0.3.0~151 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=542f1e6c4ac755f5ef79b2c01e099ce69a1e8520;p=pulseview.git Fix #615 by opening the output stream only if needed --- diff --git a/pv/storesession.cpp b/pv/storesession.cpp index aa290237..9a30c243 100644 --- a/pv/storesession.cpp +++ b/pv/storesession.cpp @@ -55,6 +55,7 @@ using Glib::VariantBase; using sigrok::ConfigKey; using sigrok::Error; using sigrok::OutputFormat; +using sigrok::OutputFlag; namespace pv { @@ -140,8 +141,9 @@ bool StoreSession::start() map options = options_; - output_stream_.open(file_name_, ios_base::binary | - ios_base::trunc | ios_base::out); + if (!output_format_->test_flag(OutputFlag::INTERNAL_IO_HANDLING)) + output_stream_.open(file_name_, ios_base::binary | + ios_base::trunc | ios_base::out); output_ = output_format_->create_output(file_name_, device, options); auto meta = context->create_meta_packet(