mpeg2dec: Use gst_pad_peer_query() instead of getting the peer pad manually

This commit is contained in:
Sebastian Dröge 2010-10-19 16:30:51 +02:00
parent 7fb7129a83
commit 0fa75d404b

View file

@ -1525,17 +1525,12 @@ 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;
}
if ((res = gst_pad_peer_query (mpeg2dec->sinkpad, query)))
break;
/* save requested format */
gst_query_parse_position (query, &format, NULL);