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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6247>
This commit is contained in:
Loïc Le Page 2024-02-28 13:21:51 +01:00 committed by GStreamer Marge Bot
parent d5734159d1
commit 7f4c0e6fb1

View file

@ -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");