diff options
author | wm4 <wm4@nowhere> | 2014-12-01 15:28:06 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-12-01 15:28:06 +0100 |
commit | b0ed93d87ddf351a6983d3cb87063c75efa04281 (patch) | |
tree | 192ce677bd3159c1820eb9bc71bbc1a047621287 /audio/out/ao_coreaudio.c | |
parent | 98da9afb8fcadca2a015a5aa44df2f37ada84f52 (diff) | |
download | mpv-b0ed93d87ddf351a6983d3cb87063c75efa04281.tar.bz2 mpv-b0ed93d87ddf351a6983d3cb87063c75efa04281.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_coreaudio.c')
-rw-r--r-- | audio/out/ao_coreaudio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/audio/out/ao_coreaudio.c b/audio/out/ao_coreaudio.c index 1e1ad8cb10..6498f3ecad 100644 --- a/audio/out/ao_coreaudio.c +++ b/audio/out/ao_coreaudio.c @@ -185,7 +185,7 @@ static bool init_chmap(struct ao *ao) &layouts, &n_layouts); CHECK_CA_ERROR("could not get audio device prefered layouts"); - struct mp_chmap_sel chmap_sel = {0}; + struct mp_chmap_sel chmap_sel = {.tmp = p}; for (int i = 0; i < n_layouts; i++) { struct mp_chmap chmap = {0}; if (ca_layout_to_mp_chmap(ao, &layouts[i], &chmap)) |