[vlc-commits] spatialaudio: fix flush when blocks have different length
Thomas Guillem
git at videolan.org
Tue Mar 13 15:12:59 CET 2018
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Mar 13 15:09:23 2018 +0100| [5e8c3cf6e1cf3521bb99db70654974df9fa2ed8f] | 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
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5e8c3cf6e1cf3521bb99db70654974df9fa2ed8f
---
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);
More information about the vlc-commits
mailing list