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.
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);