[vlc-commits] speex: don't require a valid channel layout

Thomas Guillem git at videolan.org
Mon Jul 10 17:13:50 CEST 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Jul  7 11:40:07 2017 +0200| [385e8abdc41d6a8ff9162d2ee38c897aff3de826] | committer: Thomas Guillem

speex: don't require a valid channel layout

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=385e8abdc41d6a8ff9162d2ee38c897aff3de826
---

 modules/audio_filter/resampler/speex.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/modules/audio_filter/resampler/speex.c b/modules/audio_filter/resampler/speex.c
index ee37ea95d9..a1e09e4eb8 100644
--- a/modules/audio_filter/resampler/speex.c
+++ b/modules/audio_filter/resampler/speex.c
@@ -65,10 +65,8 @@ static int OpenResampler (vlc_object_t *obj)
     /* Cannot convert format */
     if (filter->fmt_in.audio.i_format != filter->fmt_out.audio.i_format
     /* Cannot remix */
-     || filter->fmt_in.audio.i_physical_channels
-                                  != filter->fmt_out.audio.i_physical_channels
-     || filter->fmt_in.audio.i_original_channels
-                                  != filter->fmt_out.audio.i_original_channels)
+     || filter->fmt_in.audio.i_channels != filter->fmt_out.audio.i_channels
+     || filter->fmt_in.audio.i_physical_channels == 0 )
         return VLC_EGENERIC;
 
     switch (filter->fmt_in.audio.i_format)
@@ -80,13 +78,13 @@ static int OpenResampler (vlc_object_t *obj)
 
     SpeexResamplerState *st;
 
-    unsigned channels = aout_FormatNbChannels (&filter->fmt_in.audio);
     unsigned q = var_InheritInteger (obj, "speex-resampler-quality");
     if (unlikely(q > 10))
         q = 3;
 
     int err;
-    st = speex_resampler_init(channels, filter->fmt_in.audio.i_rate,
+    st = speex_resampler_init(filter->fmt_in.audio.i_channels,
+                              filter->fmt_in.audio.i_rate,
                               filter->fmt_out.audio.i_rate, q, &err);
     if (unlikely(st == NULL))
     {



More information about the vlc-commits mailing list