ao_coreaudio: support native mono output

We can be pretty sure that AudioUnit will remix for us.

Before this commit, we usually upmixed to stereo, because the
stereo and multichannel layouts were the only whitelisted ones.
This commit is contained in:
wm4
2015-06-29 23:55:03 +02:00
parent 956b8658fb
commit 302aaddc26

View File

@@ -241,6 +241,8 @@ bool ca_init_chmap(struct ao *ao, AudioDeviceID device)
struct mp_chmap_sel chmap_sel = {.tmp = ta_ctx}; struct mp_chmap_sel chmap_sel = {.tmp = ta_ctx};
struct mp_chmap chmap = {0}; 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); AudioChannelLayout *ml = ca_query_layout(ao, device, ta_ctx);
if (ml && ca_layout_to_mp_chmap(ao, ml, &chmap)) if (ml && ca_layout_to_mp_chmap(ao, ml, &chmap))
mp_chmap_sel_add_map(&chmap_sel, &chmap); mp_chmap_sel_add_map(&chmap_sel, &chmap);