[vlc-commits] ALSA: favor channel maps with fewer unused channels

Rémi Denis-Courmont git at videolan.org
Thu Jul 25 22:21:38 CEST 2013


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Jul 25 23:21:02 2013 +0300| [a9aba401ca8873a814e48458eeee661e5d8bb3cc] | committer: Rémi Denis-Courmont

ALSA: favor channel maps with fewer unused channels

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

 modules/audio_output/alsa.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/audio_output/alsa.c b/modules/audio_output/alsa.c
index 2a4d900..5c87c1e 100644
--- a/modules/audio_output/alsa.c
+++ b/modules/audio_output/alsa.c
@@ -241,7 +241,8 @@ static unsigned SetupChannels (vlc_object_t *obj, snd_pcm_t *pcm,
         if (chans == -1)
             continue;
 
-        unsigned score = popcount (chans & *mask);
+        unsigned score = (popcount (chans & *mask) << 8)
+                       | (255 - popcount (chans));
         if (score > best_score)
         {
             best_offset = p - maps;



More information about the vlc-commits mailing list