mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 16:50:47 +00:00
wavparse: convert all non GST_FORMAT_BYTES to format bytes.
Convert all non GST_FORMAT_BYTES to format bytes: fixes: GStreamer-CRITICAL **: gst_query_set_duration: assertion `format == g_value_get_enum (gst_structure_id_get_value (s, GST_QUARK (FORMAT)))' failed when playing more than one wav stream. gst-plugins-base/tests/icles/playback/test7 uri1.wav uri2.wav
This commit is contained in:
parent
cbf3c2bac0
commit
7b16eb49b8
1 changed files with 14 additions and 10 deletions
|
@ -2742,14 +2742,14 @@ gst_wavparse_pad_query (GstPad * pad, GstObject * parent, GstQuery * query)
|
|||
GST_INFO_OBJECT (wav, "pos query at %" G_GINT64_FORMAT, curb);
|
||||
|
||||
switch (format) {
|
||||
case GST_FORMAT_TIME:
|
||||
res = gst_wavparse_pad_convert (pad, GST_FORMAT_BYTES, curb,
|
||||
&format, &cur);
|
||||
break;
|
||||
default:
|
||||
case GST_FORMAT_BYTES:
|
||||
format = GST_FORMAT_BYTES;
|
||||
cur = curb;
|
||||
break;
|
||||
default:
|
||||
res = gst_wavparse_pad_convert (pad, GST_FORMAT_BYTES, curb,
|
||||
&format, &cur);
|
||||
break;
|
||||
}
|
||||
if (res)
|
||||
gst_query_set_position (query, format, cur);
|
||||
|
@ -2768,18 +2768,22 @@ gst_wavparse_pad_query (GstPad * pad, GstObject * parent, GstQuery * query)
|
|||
gst_query_parse_duration (query, &format, NULL);
|
||||
|
||||
switch (format) {
|
||||
case GST_FORMAT_TIME:{
|
||||
case GST_FORMAT_BYTES:{
|
||||
format = GST_FORMAT_BYTES;
|
||||
duration = wav->datasize;
|
||||
break;
|
||||
}
|
||||
case GST_FORMAT_TIME:
|
||||
if ((res = gst_wavparse_calculate_duration (wav))) {
|
||||
duration = wav->duration;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
format = GST_FORMAT_BYTES;
|
||||
duration = wav->datasize;
|
||||
res = FALSE;
|
||||
break;
|
||||
}
|
||||
gst_query_set_duration (query, format, duration);
|
||||
if (res)
|
||||
gst_query_set_duration (query, format, duration);
|
||||
break;
|
||||
}
|
||||
case GST_QUERY_CONVERT:
|
||||
|
|
Loading…
Reference in a new issue