From ecc6e379b24dd5e37b864ae599a154880a2bd2d0 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 9 May 2013 18:06:26 +0200 Subject: audio/out: channel map selection Make all AOs use what has been introduced in the previous commit. Note that even AOs which can handle all possible layouts (like ao_null) use the new functions. This might be important if in the future ao_select_champ() possibly honors global user options about downmixing and so on. --- audio/out/ao_oss.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'audio/out/ao_oss.c') diff --git a/audio/out/ao_oss.c b/audio/out/ao_oss.c index 805a14cd8f..4ff97b30b6 100644 --- a/audio/out/ao_oss.c +++ b/audio/out/ao_oss.c @@ -340,7 +340,10 @@ ac3_retry: af_fmt2str_short(ao_data.format), af_fmt2str_short(format)); if(!AF_FORMAT_IS_AC3(format)) { - mp_chmap_reorder_to_alsa(&ao_data.channels); + struct mp_chmap_sel sel = {0}; + mp_chmap_sel_add_alsa_def(&sel); + if (!ao_chmap_sel_adjust(&ao_data, &sel, &ao_data.channels)) + return 0; int reqchannels = ao_data.channels.num; // We only use SNDCTL_DSP_CHANNELS for >2 channels, in case some drivers don't have it if (reqchannels > 2) { @@ -357,7 +360,8 @@ ac3_retry: mp_tmsg(MSGT_AO,MSGL_ERR,"[AO OSS] audio_setup: Failed to set audio device to %d channels.\n", reqchannels); return 0; } - mp_chmap_from_channels(&ao_data.channels, c + 1); + if (!ao_chmap_sel_get_def(&ao_data, &sel, &ao_data.channels, c + 1)) + return 0; } mp_msg(MSGT_AO,MSGL_V,"audio_setup: using %d channels (requested: %d)\n", ao_data.channels.num, reqchannels); // set rate -- cgit v1.2.3