From: Soeren Apel Date: Tue, 22 May 2018 07:24:13 +0000 (+0200) Subject: Session: Allow an SR_DF_META packet to override the samplerate X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=014293fc0c203bf0ecae1a18350d09a6501538dc Session: Allow an SR_DF_META packet to override the samplerate Otherwise, the sample rate determined by the read_config() call in Session::sample_thread_proc() will be kept even if it's wrong and the driver wants to submit the correct one. --- diff --git a/pv/session.cpp b/pv/session.cpp index 6767951c..4aba385b 100644 --- a/pv/session.cpp +++ b/pv/session.cpp @@ -1048,15 +1048,10 @@ void Session::feed_in_meta(shared_ptr 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 + cur_samplerate_ = g_variant_get_uint64(entry.second.gobj()); break; default: - // Unknown metadata is not an error. + qDebug() << "Received meta data key" << entry.first->id() << ", ignoring."; break; } }