Commit 7b16eb49 authored by Alban Browaeys's avatar Alban Browaeys Committed by Sebastian Dröge

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
parent cbf3c2ba
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment