basesrc: don't handle SEEKING queries for formats that don't match the one the source operates in

Return FALSE in basesrc's default query handler when we get a SEEKING query for
a format that's not the one the source operates in. Previously (ie. before, in
the git version) we would return TRUE in that case and seekable=FALSE, which
is more correct, but causes backwards compatibility problems. (Before that
we would change the format of the query when answering, which was completely
broken since callers don't expect that or check for it). Since the SEEKING
query is a fairly recent addition, not all demuxers, parsers and decoders
implement it yet, in which case any SEEKING query by an application will
just be passed upstream where it will then be handled by basesrc. Now, if
e.g. totem does a SEEKING query for TIME format and we have a demuxer that
doesn't implement the query, basesrc would answer it with seekable=FALSE in
most cases, and totem can only take that as authoritative answer, not knowing
that the demuxer doesn't implement the SEEKING query. To avoid this, we make
basesrc return FALSE to SEEKING queries in unhandled formats. That way
applications like totem can fall back on assuming seekability depending on
whether a duration is available, or somesuch. Downstream elements doing
such queries are likely to equate an unhandled query with a non-seekable
response as well, so this should be an acceptable fix for the time being.

See #584838, #588944, #589423 and #589424.
This commit is contained in:
Robin Stocker 2009-07-24 09:50:19 +01:00 committed by Tim-Philipp Müller
parent 01014d6717
commit 527da05476

View file

@ -856,10 +856,14 @@ gst_base_src_default_query (GstBaseSrc * src, GstQuery * query)
if (format == src->segment.format) {
gst_query_set_seeking (query, src->segment.format,
gst_base_src_seekable (src), 0, src->segment.duration);
res = TRUE;
} else {
gst_query_set_seeking (query, format, FALSE, 0, -1);
/* FIXME 0.11: return TRUE + seekable=FALSE for SEEKING query here */
/* Don't reply to the query to make up for demuxers which don't
* handle the SEEKING query yet. Players like Totem will fall back
* to the duration when the SEEKING query isn't answered. */
res = FALSE;
}
res = TRUE;
break;
}
case GST_QUERY_SEGMENT: