diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2020-05-06 11:47:56 +0300 |
---|---|---|
committer | GStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2020-05-06 08:51:38 +0000 |
commit | 77784c7abacaad35e56f86e938b65947c59f2d18 (patch) | |
tree | 3a6a9c3f5bf6d8a4cdab6ef543a8c37a06cda643 /ext/musepack | |
parent | 4cf362e2df0fb809ea0f21dd4a6fbb8b46ca54ef (diff) | |
download | gstreamer-plugins-bad-77784c7abacaad35e56f86e938b65947c59f2d18.tar.gz |
musepackdec: Don't fail all queries if no sample rate is known yet
The sample rate is only needed for the POSITION/DURATION queries and we
would otherwise fail important queries like the CAPS query.
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/498
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1248>
Diffstat (limited to 'ext/musepack')
-rw-r--r-- | ext/musepack/gstmusepackdec.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ext/musepack/gstmusepackdec.c b/ext/musepack/gstmusepackdec.c index 8a0da18aa..892828b6b 100644 --- a/ext/musepack/gstmusepackdec.c +++ b/ext/musepack/gstmusepackdec.c @@ -282,13 +282,13 @@ gst_musepackdec_src_query (GstPad * pad, GstObject * parent, GstQuery * query) samplerate = g_atomic_int_get (&musepackdec->rate); - if (samplerate == 0) - goto done; - switch (GST_QUERY_TYPE (query)) { case GST_QUERY_POSITION:{ gint64 cur, cur_off; + if (samplerate == 0) + goto done; + gst_query_parse_position (query, &format, NULL); GST_OBJECT_LOCK (musepackdec); @@ -308,6 +308,9 @@ gst_musepackdec_src_query (GstPad * pad, GstObject * parent, GstQuery * query) case GST_QUERY_DURATION:{ gint64 len, len_off; + if (samplerate == 0) + goto done; + gst_query_parse_duration (query, &format, NULL); GST_OBJECT_LOCK (musepackdec); |