diff options
author | wm4 <wm4@nowhere> | 2014-12-01 15:28:06 +0100 |
---|---|---|
committer | Alessandro Ghedini <alessandro@ghedini.me> | 2014-12-01 15:41:26 +0100 |
commit | 74270cd1db56da84e244ba7102ea0b6c543c9a34 (patch) | |
tree | cd602432ef065855a9022b9318f47d5e7dc61fdf /audio/out/ao_alsa.c | |
parent | 718bf3b39e9f1febc6e93d4b9c20a37cabe0b9e3 (diff) | |
download | mpv-74270cd1db56da84e244ba7102ea0b6c543c9a34.tar.bz2 mpv-74270cd1db56da84e244ba7102ea0b6c543c9a34.tar.xz |
audio: allow more than 20 channel map entries
This could trigger an assertion when using ao_alsa or ao_coreaudio. The
code was simply assuming the number of channel maps was bounded
statically (which was true at first in both AOs).
Fix by using dynamic memory allocation. It needs to be explicitly
enabled by the AOs by setting a temp context, because otherwise the
memory couldn't be freed. (Or at least this seems to be the most elegant
solution.)
Fixes #1306.
Diffstat (limited to 'audio/out/ao_alsa.c')
-rw-r--r-- | audio/out/ao_alsa.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/audio/out/ao_alsa.c b/audio/out/ao_alsa.c index 86745c6e80..4e54f161fe 100644 --- a/audio/out/ao_alsa.c +++ b/audio/out/ao_alsa.c @@ -279,7 +279,7 @@ static int find_alsa_channel(int mp_channel) static bool query_chmaps(struct ao *ao, struct mp_chmap *chmap) { struct priv *p = ao->priv; - struct mp_chmap_sel chmap_sel = {0}; + struct mp_chmap_sel chmap_sel = {.tmp = p}; snd_pcm_chmap_query_t **maps = snd_pcm_query_chmaps(p->alsa); if (!maps) |