diff --git a/audio/out/ao_coreaudio_chmap.c b/audio/out/ao_coreaudio_chmap.c index 94c9179db8..1f299cedc2 100644 --- a/audio/out/ao_coreaudio_chmap.c +++ b/audio/out/ao_coreaudio_chmap.c @@ -242,8 +242,6 @@ bool ca_init_chmap(struct ao *ao, AudioDeviceID device) struct mp_chmap_sel chmap_sel = {.tmp = ta_ctx}; struct mp_chmap chmap = {0}; - mp_chmap_sel_add_map(&chmap_sel, &(struct mp_chmap)MP_CHMAP_INIT_MONO); - AudioChannelLayout *ml = ca_query_layout(ao, device, ta_ctx); if (ml && ca_layout_to_mp_chmap(ao, ml, &chmap)) mp_chmap_sel_add_map(&chmap_sel, &chmap); @@ -252,6 +250,11 @@ bool ca_init_chmap(struct ao *ao, AudioDeviceID device) if (sl && ca_layout_to_mp_chmap(ao, sl, &chmap)) mp_chmap_sel_add_map(&chmap_sel, &chmap); + if (!chmap_sel.num_chmaps) + mp_chmap_sel_add_map(&chmap_sel, &(struct mp_chmap)MP_CHMAP_INIT_STEREO); + + mp_chmap_sel_add_map(&chmap_sel, &(struct mp_chmap)MP_CHMAP_INIT_MONO); + if (!ao_chmap_sel_adjust(ao, &chmap_sel, &ao->channels)) { MP_ERR(ao, "could not select a suitable channel map among the " "hardware supported ones. Make sure to configure your "