mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
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:
parent
26cd4ee3a0
commit
7fb7129a83
1 changed files with 10 additions and 0 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue