[vlc-commits] [Git][videolan/vlc][master] 2 commits: simple: always set the 5.1 output LFE channel

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sun Nov 15 23:06:26 UTC 2026



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
b607e73d by Rémi Denis-Courmont at 2026-11-15T23:48:56+01:00
simple: always set the 5.1 output LFE channel

...even if the input is 7.0, without LFE channel.

- - - - -
cffc1352 by Rémi Denis-Courmont at 2026-11-15T23:48:56+01:00
simple: only set output LFE if present

Fixes #30309.
Reported-as: ANT-2026-FJFO97W2

- - - - -


1 changed file:

- modules/audio_filter/channel_mixer/simple.c


Changes:

=====================================
modules/audio_filter/channel_mixer/simple.c
=====================================
@@ -220,6 +220,10 @@ static void DoWork_5_x_to_4_0( filter_t * p_filter,  block_t * p_in_buf, block_t
 static void DoWork_7_x_to_5_x( filter_t * p_filter,  block_t * p_in_buf, block_t * p_out_buf ) {
     float *p_dest = (float *)p_out_buf->p_buffer;
     const float *p_src = (const float *)p_in_buf->p_buffer;
+    bool in_lfe = (p_filter->fmt_in.audio.i_physical_channels & AOUT_CHAN_LFE) != 0;
+    bool out_lfe = (p_filter->fmt_out.audio.i_physical_channels & AOUT_CHAN_LFE) != 0;
+    int stride = 7 + in_lfe;
+
     for( int i = p_in_buf->i_nb_samples; i--; )
     {
         *p_dest++ = p_src[0];
@@ -227,20 +231,17 @@ static void DoWork_7_x_to_5_x( filter_t * p_filter,  block_t * p_in_buf, block_t
         *p_dest++ = (p_src[2] + p_src[4]) * 0.5f;
         *p_dest++ = (p_src[3] + p_src[5]) * 0.5f;
         *p_dest++ = p_src[6];
-
-        p_src += 7;
-
-        if( p_filter->fmt_in.audio.i_physical_channels & AOUT_CHAN_LFE &&
-            p_filter->fmt_out.audio.i_physical_channels & AOUT_CHAN_LFE )
-            *p_dest++ = *p_src++;
-        else if( p_filter->fmt_in.audio.i_physical_channels & AOUT_CHAN_LFE ) p_src++;
+        if( out_lfe )
+            *(p_dest++) = in_lfe ? p_src[7] : 0.f;
+        p_src += stride;
     }
 }
 
 static void DoWork_6_1_to_5_x( filter_t * p_filter,  block_t * p_in_buf, block_t * p_out_buf ) {
-    VLC_UNUSED(p_filter);
     float *p_dest = (float *)p_out_buf->p_buffer;
     const float *p_src = (const float *)p_in_buf->p_buffer;
+    bool out_lfe = (p_filter->fmt_out.audio.i_physical_channels & AOUT_CHAN_LFE) != 0;
+
     for( int i = p_in_buf->i_nb_samples; i--; )
     {
         *p_dest++ = p_src[0];
@@ -248,11 +249,9 @@ static void DoWork_6_1_to_5_x( filter_t * p_filter,  block_t * p_in_buf, block_t
         *p_dest++ = (p_src[2] + p_src[4]) * 0.5f;
         *p_dest++ = (p_src[3] + p_src[4]) * 0.5f;
         *p_dest++ = p_src[5];
-
+        if( out_lfe )
+            *(p_dest++) = p_src[6]; // input always has LFE here
         p_src += 6;
-
-        /* We always have LFE here */
-        *p_dest++ = *p_src++;
     }
 }
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/ed6d4aa119da0e79ba7680100a4724af82c740ec...cffc1352cda4f8c87e557ab10916ce9e6b01ec86

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/ed6d4aa119da0e79ba7680100a4724af82c740ec...cffc1352cda4f8c87e557ab10916ce9e6b01ec86
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list