From: Sebastian Dröge Date: Mon, 29 Jul 2013 09:01:09 +0000 (+0200) Subject: tsdemux: Implement SEGMENT query X-Git-Tag: 1.1.3~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=12981a5d82d84ecb013eb304835f282dd42e73cc;p=platform%2Fupstream%2Fgst-plugins-bad.git tsdemux: Implement SEGMENT query --- diff --git a/gst/mpegtsdemux/tsdemux.c b/gst/mpegtsdemux/tsdemux.c index f254a40..6b2b2b8 100644 --- a/gst/mpegtsdemux/tsdemux.c +++ b/gst/mpegtsdemux/tsdemux.c @@ -462,6 +462,31 @@ gst_ts_demux_srcpad_query (GstPad * pad, GstObject * parent, GstQuery * query) } break; } + case GST_QUERY_SEGMENT:{ + GstFormat format; + gint64 start, stop; + + format = demux->segment.format; + + start = + gst_segment_to_stream_time (&demux->segment, format, + demux->segment.start); + if ((stop = demux->segment.stop) == -1) + stop = demux->segment.duration; + else + stop = gst_segment_to_stream_time (&demux->segment, format, stop); + + if (demux->segment.rate < 0.0) { + gint64 tmp; + tmp = stop; + stop = start; + start = tmp; + } + + gst_query_set_segment (query, demux->segment.rate, format, start, stop); + res = TRUE; + break; + } default: res = gst_pad_query_default (pad, parent, query); }