From 8ba5fb0b28f479b924b779095dc44d9504ce7ce5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 2 Sep 2013 13:53:51 +0200 Subject: [PATCH] outputselector: Don't adjust segment->start to the current time when switching pads This does not make any sense at all and breaks timestamp->running_time calculations in unpredictable ways. https://bugzilla.gnome.org/show_bug.cgi?id=707130 --- plugins/elements/gstoutputselector.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/plugins/elements/gstoutputselector.c b/plugins/elements/gstoutputselector.c index fe5f99d06a..531c3d9240 100644 --- a/plugins/elements/gstoutputselector.c +++ b/plugins/elements/gstoutputselector.c @@ -368,7 +368,6 @@ gst_output_selector_switch (GstOutputSelector * osel) gboolean res = FALSE; GstEvent *ev = NULL; GstSegment *seg = NULL; - gint64 start = 0, position = 0; /* Switch */ GST_OBJECT_LOCK (GST_OBJECT (osel)); @@ -391,13 +390,9 @@ gst_output_selector_switch (GstOutputSelector * osel) /* If resending then mark segment start and position accordingly */ if (osel->resend_latest && osel->latest_buffer && GST_BUFFER_TIMESTAMP_IS_VALID (osel->latest_buffer)) { - start = position = GST_BUFFER_TIMESTAMP (osel->latest_buffer); - } else { - start = position = seg->position; + seg->position = GST_BUFFER_TIMESTAMP (osel->latest_buffer); } - seg->start = start; - seg->position = position; ev = gst_event_new_segment (seg); if (!gst_pad_push_event (osel->active_srcpad, ev)) {