From 5e8c3cf6e1cf3521bb99db70654974df9fa2ed8f Mon Sep 17 00:00:00 2001 From: Thomas Guillem Date: Tue, 13 Mar 2018 15:09:23 +0100 Subject: [PATCH] spatialaudio: fix flush when blocks have different length The calculation was wrong, we should compare the length of the previous block. Regression from 1f246d2604822174812a2cab63111d95ad6ea27a --- modules/audio_filter/channel_mixer/spatialaudio.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/audio_filter/channel_mixer/spatialaudio.cpp b/modules/audio_filter/channel_mixer/spatialaudio.cpp index 36f3c13fc5..a579a45cad 100644 --- a/modules/audio_filter/channel_mixer/spatialaudio.cpp +++ b/modules/audio_filter/channel_mixer/spatialaudio.cpp @@ -168,9 +168,9 @@ static block_t *Mix( filter_t *p_filter, block_t *p_buf ) /* Detect discontinuity due to a pause */ static const mtime_t rounding_error = 10; if( p_sys->i_inputPTS != 0 - && p_buf->i_pts - p_sys->i_last_input_pts - p_buf->i_length > rounding_error ) + && p_buf->i_pts - p_sys->i_last_input_pts > rounding_error ) Flush( p_filter ); - p_sys->i_last_input_pts = p_buf->i_pts; + p_sys->i_last_input_pts = p_buf->i_pts + p_buf->i_length; const size_t i_prevSize = p_sys->inputSamples.size(); p_sys->inputSamples.resize(i_prevSize + p_buf->i_nb_samples * p_sys->i_inputNb); -- 2.11.4.GIT