mirror of
https://github.com/mpv-player/mpv.git
synced 2026-10-28 23:13:18 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user