[vlc-commits] [Git][videolan/vlc][master] pipewire: fix channel order

François Cartegnie (@fcartegnie) gitlab at videolan.org
Tue Sep 1 16:33:04 UTC 2026



François Cartegnie pushed to branch master at VideoLAN / VLC


Commits:
66156926 by Rémi Denis-Courmont at 2026-09-01T18:16:37+02:00
pipewire: fix channel order

Pointed-out-by: Mathias Anderssén <mathias.anderssen at gmail.com>

- - - - -


1 changed file:

- modules/audio_output/pipewire.c


Changes:

=====================================
modules/audio_output/pipewire.c
=====================================
@@ -528,24 +528,24 @@ static struct vlc_pw_stream *vlc_pw_stream_create(audio_output_t *aout,
             return NULL;
         }
 
+        // NOTE: MUST match VLC (WG4) order
         static const unsigned char map[] = {
-            SPA_AUDIO_CHANNEL_FC,
             SPA_AUDIO_CHANNEL_FL,
             SPA_AUDIO_CHANNEL_FR,
-            0 /* unassigned */,
-            SPA_AUDIO_CHANNEL_RC,
-            SPA_AUDIO_CHANNEL_RL,
-            SPA_AUDIO_CHANNEL_RR,
-            0 /* unassigned */,
             SPA_AUDIO_CHANNEL_SL,
             SPA_AUDIO_CHANNEL_SR,
-            0 /* unassigned */,
-            0 /* unassigned */,
+            SPA_AUDIO_CHANNEL_RL,
+            SPA_AUDIO_CHANNEL_RR,
+            SPA_AUDIO_CHANNEL_RC,
+            SPA_AUDIO_CHANNEL_FC,
             SPA_AUDIO_CHANNEL_LFE,
         };
 
+        static_assert (ARRAY_SIZE(map) <= ARRAY_SIZE(pi_vlc_chan_order_wg4),
+                       "Array size mismatch");
+
         for (size_t i = 0; i < ARRAY_SIZE(map); i++)
-            if ((fmt->i_physical_channels >> i) & 1)
+            if (fmt->i_physical_channels & pi_vlc_chan_order_wg4[i])
                 rawfmt.position[mapped++] = map[i];
 
         while (mapped < fmt->i_channels) {



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/661569265c1e51d86b8753f3f975e67629e49b90

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/661569265c1e51d86b8753f3f975e67629e49b90
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