[vlc-commits] ALSA: only set channels that are actually mapped (fixes #8934)
Rémi Denis-Courmont
git at videolan.org
Wed Jul 10 22:26:53 CEST 2013
vlc/vlc-2.1 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Jul 10 23:24:47 2013 +0300| [86638e9266556945f8d999ab7e0cace9ab77d2e1] | committer: Rémi Denis-Courmont
ALSA: only set channels that are actually mapped (fixes #8934)
The code failed to clear unmapped channels present in the input.
(cherry picked from commit d3a43ec88f34eca9c59151c076bb7226a9db5d8c)
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.1.git/?a=commit;h=86638e9266556945f8d999ab7e0cace9ab77d2e1
---
modules/audio_output/alsa.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/modules/audio_output/alsa.c b/modules/audio_output/alsa.c
index 350d509..9a231aa 100644
--- a/modules/audio_output/alsa.c
+++ b/modules/audio_output/alsa.c
@@ -207,19 +207,21 @@ static int Map2Mask (vlc_object_t *obj, const snd_pcm_chmap_t *restrict map)
* Compares a fixed ALSA channels map with the VLC channels order.
*/
static unsigned SetupChannelsFixed(const snd_pcm_chmap_t *restrict map,
- uint16_t *restrict mask, uint8_t *restrict tab)
+ uint16_t *restrict maskp, uint8_t *restrict tab)
{
uint32_t chans_out[AOUT_CHAN_MAX];
+ uint16_t mask = 0;
for (unsigned i = 0; i < map->channels; i++)
{
uint_fast16_t vlc_chan = vlc_chans[map->pos[i]];
chans_out[i] = vlc_chan;
- *mask |= vlc_chan;
+ mask |= vlc_chan;
}
- return aout_CheckChannelReorder(NULL, chans_out, *mask, tab);
+ *maskp = mask;
+ return aout_CheckChannelReorder(NULL, chans_out, mask, tab);
}
/**
More information about the vlc-commits
mailing list