From 014293fc0c203bf0ecae1a18350d09a6501538dc Mon Sep 17 00:00:00 2001 From: Soeren Apel Date: Tue, 22 May 2018 09:24:13 +0200 Subject: [PATCH] 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. --- pv/session.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) 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; } } -- 2.30.2