From cfd28a6f90a5ebde071d5dcb7f984f7db9b35db1 Mon Sep 17 00:00:00 2001 From: Youness Alaoui Date: Tue, 23 Aug 2011 22:40:25 +0000 Subject: [PATCH] tsdemux: Forward seek/duration query/event to the sinkpad --- gst/mpegtsdemux/mpegtsbase.c | 2 +- gst/mpegtsdemux/tsdemux.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gst/mpegtsdemux/mpegtsbase.c b/gst/mpegtsdemux/mpegtsbase.c index 9b0f702bc8..1749ba2ccc 100644 --- a/gst/mpegtsdemux/mpegtsbase.c +++ b/gst/mpegtsdemux/mpegtsbase.c @@ -1417,7 +1417,7 @@ mpegts_base_handle_seek_event (MpegTSBase * base, GstPad * pad, return FALSE; /* First try if upstream supports seeking in TIME format */ - if (gst_pad_push_event (pad, gst_event_ref (event))) { + if (gst_pad_push_event (base->sinkpad, gst_event_ref (event))) { GST_DEBUG ("upstream handled SEEK event"); gst_event_unref (event); return TRUE; diff --git a/gst/mpegtsdemux/tsdemux.c b/gst/mpegtsdemux/tsdemux.c index 350aaeb247..df618300aa 100644 --- a/gst/mpegtsdemux/tsdemux.c +++ b/gst/mpegtsdemux/tsdemux.c @@ -387,15 +387,17 @@ gst_ts_demux_srcpad_query (GstPad * pad, GstQuery * query) gboolean res = TRUE; GstFormat format; GstTSDemux *demux; + MpegTSBase *base; demux = GST_TS_DEMUX (gst_pad_get_parent (pad)); + base = GST_MPEGTS_BASE (demux); switch (GST_QUERY_TYPE (query)) { case GST_QUERY_DURATION: GST_DEBUG ("query duration"); gst_query_parse_duration (query, &format, NULL); if (format == GST_FORMAT_TIME) { - if (!gst_pad_peer_query (pad, query)) + if (!gst_pad_peer_query (base->sinkpad, query)) gst_query_set_duration (query, GST_FORMAT_TIME, demux->segment.duration); } else { @@ -409,7 +411,7 @@ gst_ts_demux_srcpad_query (GstPad * pad, GstQuery * query) if (format == GST_FORMAT_TIME) { gboolean seekable = FALSE; - if (gst_pad_peer_query (pad, query)) + if (gst_pad_peer_query (base->sinkpad, query)) gst_query_parse_seeking (query, NULL, &seekable, NULL, NULL); /* If upstream is not seekable in TIME format we use -- 2.34.1