X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fsession.cpp;h=6767951cf85961ea303d9fc6f830e8a7d9eb576d;hp=50e89e567041c2ec186e47e0d387457808f452a3;hb=a9674d1c8c5ab81b6ea642ce263d2dd316f0e33c;hpb=d7168e582c71ebcc359b12efed83daa2a6b6f28e diff --git a/pv/session.cpp b/pv/session.cpp index 50e89e5..6767951 100644 --- a/pv/session.cpp +++ b/pv/session.cpp @@ -483,7 +483,6 @@ void Session::load_init_file(const string &file_name, const string &format) map input_opts; if (!format.empty()) { - // Got a user provided input format spec. const map > formats = device_manager_.context()->input_formats(); auto user_opts = pv::util::split_string(format, ":"); @@ -500,11 +499,6 @@ void Session::load_init_file(const string &file_name, const string &format) input_format = (*iter).second; input_opts = input_format_options(user_opts, input_format->options()); - } else { - // (Try to) auto detect the input format. Lookup failure - // is not fatal, when no input module claimed responsibility, - // then a session file gets loaded. - input_format = device_manager_.context()->input_format_match(file_name); } load_file(QString::fromStdString(file_name), input_format, input_opts); @@ -517,6 +511,10 @@ void Session::load_file(QString file_name, const QString errorMessage( QString("Failed to load file %1").arg(file_name)); + // In the absence of a caller's format spec, try to auto detect. + // Assume "sigrok session file" upon lookup miss. + if (!format) + format = device_manager_.context()->input_format_match(file_name.toStdString()); try { if (format) set_device(shared_ptr(