mpeg2dec: fix position query by trusting upstream

Position queries are badly handled for DVDs (probably due to the division in
chapters): the time returned was the time since the start of chapter.

Now ask upstream for position queries, fall back to the old code if upstream
cannot answer the query.
This commit is contained in:
Guillaume Emont 2010-10-13 21:38:06 +02:00 committed by Sebastian Dröge
parent 26cd4ee3a0
commit 7fb7129a83

View file

@ -1525,8 +1525,18 @@ gst_mpeg2dec_src_query (GstPad * pad, GstQuery * query)
case GST_QUERY_POSITION:
{
GstFormat format;
GstPad *peer;
gint64 cur;
/* First, we try to ask upstream, which might know better, especially in
* the case of DVDs, with multiple chapter */
if ((peer = gst_pad_get_peer (mpeg2dec->sinkpad)) != NULL) {
res = gst_pad_query (peer, query);
gst_object_unref (peer);
if (res)
break;
}
/* save requested format */
gst_query_parse_position (query, &format, NULL);