]> sigrok.org Git - pulseview.git/blobdiff - pv/session.cpp
Session: Allow using sample rate from meta packet
[pulseview.git] / pv / session.cpp
index 2a794f0fb0c4af8a79b662e12b810ffdb28b510d..ef1159ee599f8abfbf0a7e6b90d6c100eeef3f44 100644 (file)
@@ -486,6 +486,11 @@ void Session::feed_in_meta(shared_ptr<Meta> meta)
        for (auto entry : meta->config()) {
                switch (entry.first->id()) {
                case SR_CONF_SAMPLERATE:
+                       // We can't rely on the header to always contain the sample rate,
+                       // so in case it's supplied via a meta packet, we use it.
+                       if (!cur_samplerate_)
+                               cur_samplerate_ = g_variant_get_uint64(entry.second.gobj());
+
                        /// @todo handle samplerate changes
                        break;
                default: