Commit d3a43ec8 authored by Rémi Denis-Courmont's avatar 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.
parent a2896580
...@@ -207,19 +207,21 @@ static int Map2Mask (vlc_object_t *obj, const snd_pcm_chmap_t *restrict map) ...@@ -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. * Compares a fixed ALSA channels map with the VLC channels order.
*/ */
static unsigned SetupChannelsFixed(const snd_pcm_chmap_t *restrict map, 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]; uint32_t chans_out[AOUT_CHAN_MAX];
uint16_t mask = 0;
for (unsigned i = 0; i < map->channels; i++) for (unsigned i = 0; i < map->channels; i++)
{ {
uint_fast16_t vlc_chan = vlc_chans[map->pos[i]]; uint_fast16_t vlc_chan = vlc_chans[map->pos[i]];
chans_out[i] = vlc_chan; 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);
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment