Commit c1e13d4c authored by Thomas Guillem's avatar 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 1f246d26

(cherry picked from commit 5e8c3cf6)
Signed-off-by: Thomas Guillem's avatarThomas Guillem <thomas@gllm.fr>
parent 535aed6b
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment