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:
Alban Browaeys 2012-07-23 08:49:07 +02:00 committed by Sebastian Dröge
parent cbf3c2bac0
commit 7b16eb49b8

View file

@ -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: