mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
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>
This commit is contained in:
parent
4cf362e2df
commit
77784c7aba
1 changed files with 6 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue