[vlc-devel] [PATCH 3/3] soxr: fix output len too small
Thomas Guillem
thomas at gllm.fr
Mon May 4 14:47:01 CEST 2020
This was happening when the instant ratio was smaller than the fixed ratio
(when the user ask for a playback speed > 1).
Fixes issue 956 on vlc-android.
---
modules/audio_filter/resampler/soxr.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/modules/audio_filter/resampler/soxr.c b/modules/audio_filter/resampler/soxr.c
index 81590c827f8..1490d30c63e 100644
--- a/modules/audio_filter/resampler/soxr.c
+++ b/modules/audio_filter/resampler/soxr.c
@@ -312,7 +312,8 @@ Resample( filter_t *p_filter, block_t *p_in )
block_t *p_flushed_out = NULL, *p_out = NULL;
const double f_ratio = p_filter->fmt_out.audio.i_rate
/ (double) p_filter->fmt_in.audio.i_rate;
- const size_t i_olen = SoXR_GetOutLen( p_in->i_nb_samples, f_ratio );
+ size_t i_olen = SoXR_GetOutLen( p_in->i_nb_samples,
+ f_ratio > p_sys->f_fixed_ratio ? f_ratio : p_sys->f_fixed_ratio );
if( f_ratio != p_sys->f_fixed_ratio )
{
--
2.20.1
More information about the vlc-devel
mailing list