From 1c4f32b2795b0b297a837af64e15dfa460b47461 Mon Sep 17 00:00:00 2001 From: Chris E Jones Date: Tue, 22 Mar 2011 13:46:42 +0100 Subject: [PATCH] scaletempo: Correctly handle newsegment events with stop==-1 Fixes bug #645420. --- gst/scaletempo/gstscaletempo.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gst/scaletempo/gstscaletempo.c b/gst/scaletempo/gstscaletempo.c index 5f64b41861..ba82a85823 100644 --- a/gst/scaletempo/gstscaletempo.c +++ b/gst/scaletempo/gstscaletempo.c @@ -554,8 +554,13 @@ gst_scaletempo_sink_event (GstBaseTransform * trans, GstEvent * event) applied_rate = priv->scale; rate = 1.0; //gst_event_unref (event); + + if (stop != -1) { + stop = (stop - start) / applied_rate + start; + } + event = gst_event_new_new_segment_full (update, rate, applied_rate, - format, start, (stop - start) / applied_rate + start, position); + format, start, stop, position); gst_pad_push_event (GST_BASE_TRANSFORM_SRC_PAD (trans), event); return FALSE; }