[vlc-commits] spatialaudio: fix flush when blocks have different length
Thomas Guillem
git at videolan.org
Tue Mar 13 15:13:24 CET 2018
vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Mar 13 15:09:23 2018 +0100| [c1e13d4c702af42ec2183b183f8a7d385e4acb7a] | committer: Thomas Guillem
spatialaudio: fix flush when blocks have different length
The calculation was wrong, we should compare the length of the previous block.
Regression from 1f246d2604822174812a2cab63111d95ad6ea27a
(cherry picked from commit 5e8c3cf6e1cf3521bb99db70654974df9fa2ed8f)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=c1e13d4c702af42ec2183b183f8a7d385e4acb7a
---
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 ca736ff325..ee7cc8abe6 100644
--- a/modules/audio_filter/channel_mixer/spatialaudio.cpp
+++ b/modules/audio_filter/channel_mixer/spatialaudio.cpp
@@ -170,9 +170,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);
More information about the vlc-commits
mailing list