scaletempo: properly update new segments
authorThiago Santos <thiago.sousa.santos@collabora.co.uk>
Thu, 5 Nov 2009 16:40:38 +0000 (13:40 -0300)
committerTim-Philipp Müller <tim@centricular.net>
Fri, 14 Dec 2012 13:16:16 +0000 (13:16 +0000)
Scaletempo was missing an update of 'stop' in
new segment parameters when pushing it downstream,
which caused files to end earlier when rate < 1.

Fixes #599903

Based on patch by: Bastian Hecht <hechtb@gmail.com>

gst/audiofx/gstscaletempo.c

index ed25d13..7d72dba 100644 (file)
@@ -555,7 +555,7 @@ gst_scaletempo_sink_event (GstBaseTransform * trans, GstEvent * event)
       rate = 1.0;
       //gst_event_unref (event);
       event = gst_event_new_new_segment_full (update, rate, applied_rate,
-          format, start, stop, position);
+          format, start, (stop - start) / applied_rate + start, position);
       gst_pad_push_event (GST_BASE_TRANSFORM_SRC_PAD (trans), event);
       return FALSE;
     }