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.
This commit is contained in:
wm4
2015-10-26 16:00:24 +01:00
parent c1de8cdc38
commit 919707efb7
+6
View File
@@ -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