[vlc-devel] [PATCH 1/3] resampler: soxr: ensure fmt_out is correctly set

Tristan Matthews tmatth at videolan.org
Sun Feb 21 05:13:08 UTC 2021


Fixes #25477
---
 modules/audio_filter/resampler/soxr.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/audio_filter/resampler/soxr.c b/modules/audio_filter/resampler/soxr.c
index 2e4f1dbf1c..5ab3978d82 100644
--- a/modules/audio_filter/resampler/soxr.c
+++ b/modules/audio_filter/resampler/soxr.c
@@ -131,6 +131,9 @@ Open( vlc_object_t *p_obj, bool b_change_ratio )
      || !SoXR_GetFormat( p_filter->fmt_out.audio.i_format, &i_otype ) )
         return VLC_EGENERIC;
 
+    /* Ensure bitspersample + bytes_per_frame are correctly set */
+    aout_FormatPrepare(&p_filter->fmt_out.audio);
+
     filter_sys_t *p_sys = calloc( 1, sizeof( filter_sys_t ) );
     if( unlikely( p_sys == NULL ) )
         return VLC_ENOMEM;
-- 
2.25.1



More information about the vlc-devel mailing list