summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-10-26 16:00:17 +0100
committerwm4 <wm4@nowhere>2015-10-26 16:00:24 +0100
commit919707efb7f58633dadab272b941a330c4f7025b (patch)
tree8ceafe7392b594a2ce45b29462efea04f6bd1f8e
parentc1de8cdc38be75499e47fb423b594677b24c4086 (diff)
downloadmpv-919707efb7f58633dadab272b941a330c4f7025b.tar.bz2
mpv-919707efb7f58633dadab272b941a330c4f7025b.tar.xz
ao_coreaudio_exclusive: check for maximum channel count
Until recently, the channel layout code happened to catch this, but now an explicit check is needed. Otherwise, it'd try to pad the missing channels with NA in the channel map fallback code.
-rw-r--r--audio/out/ao_coreaudio_exclusive.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/audio/out/ao_coreaudio_exclusive.c b/audio/out/ao_coreaudio_exclusive.c
index 4d47ae356e..af07fe0f3e 100644
--- a/audio/out/ao_coreaudio_exclusive.c
+++ b/audio/out/ao_coreaudio_exclusive.c
@@ -300,6 +300,12 @@ static int init(struct ao *ao)
ca_print_asbd(ao, "virtual format", &p->stream_asbd);
+ if (p->stream_asbd.mChannelsPerFrame > MP_NUM_CHANNELS) {
+ MP_ERR(ao, "unsupported number of channels: %d > %d.\n",
+ p->stream_asbd.mChannelsPerFrame, MP_NUM_CHANNELS);
+ goto coreaudio_error;
+ }
+
int new_format = ca_asbd_to_mp_format(&p->stream_asbd);
// If both old and new formats are spdif, avoid changing it due to the