From f495fa7a21b8673356a4c42590129a9a83f1ca82 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Wed, 19 Sep 2012 15:14:35 +0200 Subject: [PATCH] identity: transform GAP event in single segment mode --- plugins/elements/gstidentity.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/plugins/elements/gstidentity.c b/plugins/elements/gstidentity.c index 8361a7a..be93b86 100644 --- a/plugins/elements/gstidentity.c +++ b/plugins/elements/gstidentity.c @@ -310,6 +310,20 @@ gst_identity_sink_event (GstBaseTransform * trans, GstEvent * event) } } + /* also transform GAP timestamp similar to buffer timestamps */ + if (identity->single_segment && (GST_EVENT_TYPE (event) == GST_EVENT_GAP) && + trans->have_segment && trans->segment.format == GST_FORMAT_TIME) { + GstClockTime start, dur; + + gst_event_parse_gap (event, &start, &dur); + if (GST_CLOCK_TIME_IS_VALID (start)) { + start = gst_segment_to_running_time (&trans->segment, + GST_FORMAT_TIME, start); + gst_event_unref (event); + event = gst_event_new_gap (start, dur); + } + } + /* Reset previous timestamp, duration and offsets on NEWSEGMENT * to prevent false warnings when checking for perfect streams */ if (GST_EVENT_TYPE (event) == GST_EVENT_SEGMENT) { -- 2.7.4