From 7f4c0e6fb19ac9fe2f27e36f5f3e25ec832ab16e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Le=20Page?= Date: Wed, 28 Feb 2024 13:21:51 +0100 Subject: [PATCH] pitch: fix time ratio computation When changing playing rate, the output segment was not correctly calculated because the stream time ratio was computed using the previous input segment rate instead of using the actual rate. This was producing wrong results for the output segment start and end values. Part-of: --- subprojects/gst-plugins-bad/ext/soundtouch/gstpitch.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-bad/ext/soundtouch/gstpitch.cc b/subprojects/gst-plugins-bad/ext/soundtouch/gstpitch.cc index 7c2c2aa346..41b3ac6605 100644 --- a/subprojects/gst-plugins-bad/ext/soundtouch/gstpitch.cc +++ b/subprojects/gst-plugins-bad/ext/soundtouch/gstpitch.cc @@ -711,7 +711,7 @@ gst_pitch_process_segment (GstPitch * pitch, GstEvent ** event) GST_LOG_OBJECT (pitch->sinkpad, "in segment %" GST_SEGMENT_FORMAT, &seg); - stream_time_ratio = pitch->tempo * pitch->rate * pitch->seg_arate; + stream_time_ratio = pitch->tempo * pitch->rate * our_arate; if (stream_time_ratio == 0) { GST_LOG_OBJECT (pitch->sinkpad, "stream_time_ratio is zero");