audiodecoder: handle downstream seeking query

... or not, in line with how segment events are treated.
This commit is contained in:
Mark Nauwelaerts 2012-03-28 16:41:01 +02:00
parent 69298c5534
commit 2ddc6bb63d

View file

@ -1839,6 +1839,8 @@ gst_audio_decoder_sink_query (GstPad * pad, GstObject * parent,
dec = GST_AUDIO_DECODER (parent); dec = GST_AUDIO_DECODER (parent);
GST_LOG_OBJECT (dec, "handling query: %" GST_PTR_FORMAT, query);
switch (GST_QUERY_TYPE (query)) { switch (GST_QUERY_TYPE (query)) {
case GST_QUERY_FORMATS: case GST_QUERY_FORMATS:
{ {
@ -1859,6 +1861,19 @@ gst_audio_decoder_sink_query (GstPad * pad, GstObject * parent,
gst_query_set_convert (query, src_fmt, src_val, dest_fmt, dest_val); gst_query_set_convert (query, src_fmt, src_val, dest_fmt, dest_val);
break; break;
} }
case GST_QUERY_SEEKING:
{
GstFormat format;
/* non-TIME segments are discarded, so we won't seek that way either */
gst_query_parse_seeking (query, &format, NULL, NULL, NULL);
if (format != GST_FORMAT_TIME) {
GST_DEBUG_OBJECT (dec, "discarding non-TIME SEEKING query");
res = FALSE;
break;
}
/* fall-through */
}
default: default:
res = gst_pad_query_default (pad, parent, query); res = gst_pad_query_default (pad, parent, query);
break; break;