]> sigrok.org Git - pulseview.git/commitdiff
StoreSession: Supply filename to the output module directly
authorSoeren Apel <redacted>
Wed, 29 Jul 2015 19:28:17 +0000 (21:28 +0200)
committerUwe Hermann <redacted>
Thu, 30 Jul 2015 17:22:26 +0000 (19:22 +0200)
This fixes parts of bug #570.

pv/storesession.cpp

index 1a27e5654dd9e8e66ec96fb0d773a96ad83536f0..bf214554250ac6ddf23185aa61bc448bcbf24e09 100644 (file)
@@ -137,17 +137,10 @@ bool StoreSession::start()
 
                map<string, Glib::VariantBase> options = options_;
 
 
                map<string, Glib::VariantBase> options = options_;
 
-               // If the output has the capability to write files, use it.
-               // Otherwise, open the output stream.
-               const auto opt_list = output_format_->options();
-               if (opt_list.find("filename") != opt_list.end())
-                       options["filename"] =
-                               Glib::Variant<Glib::ustring>::create(file_name_);
-               else
-                       output_stream_.open(file_name_, ios_base::binary |
-                               ios_base::trunc | ios_base::out);
-
-               output_ = output_format_->create_output(device, options);
+               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(
                        {{ConfigKey::SAMPLERATE, Glib::Variant<guint64>::create(
                                segment->samplerate())}});
                auto meta = context->create_meta_packet(
                        {{ConfigKey::SAMPLERATE, Glib::Variant<guint64>::create(
                                segment->samplerate())}});