From 4e78974c879ce371b4011e116d75632a3d24b6c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 29 Jul 2013 10:50:59 +0200 Subject: [PATCH] avidemux: Implement SEGMENT query --- gst/avi/gstavidemux.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/gst/avi/gstavidemux.c b/gst/avi/gstavidemux.c index 459cf7ef8f..f96ef4d276 100644 --- a/gst/avi/gstavidemux.c +++ b/gst/avi/gstavidemux.c @@ -578,6 +578,32 @@ gst_avi_demux_handle_src_query (GstPad * pad, GstObject * parent, res = gst_pad_query_default (pad, parent, query); break; } + case GST_QUERY_SEGMENT: + { + GstFormat format; + gint64 start, stop; + + format = avi->segment.format; + + start = + gst_segment_to_stream_time (&avi->segment, format, + avi->segment.start); + if ((stop = avi->segment.stop) == -1) + stop = avi->segment.duration; + else + stop = gst_segment_to_stream_time (&avi->segment, format, stop); + + if (avi->segment.rate < 0.0) { + gint64 tmp; + tmp = stop; + stop = start; + start = tmp; + } + + gst_query_set_segment (query, avi->segment.rate, format, start, stop); + res = TRUE; + break; + } default: res = gst_pad_query_default (pad, parent, query); break;