From 2a0a13425fac86ec9a02d615b7095ec88baa00c1 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Thu, 8 May 2014 08:06:10 +0200 Subject: [PATCH] ao_coreaudio: don't fallback to full waveext The code was falling back to the full waveext chmap_sel when less than 2 channels were detected. This new code is slightly more correct since it only fills the chmap_sel with the stereo or mono chmap in the fallback case. --- audio/out/ao_coreaudio.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/audio/out/ao_coreaudio.c b/audio/out/ao_coreaudio.c index f37a31aed6..c74648cd6b 100644 --- a/audio/out/ao_coreaudio.c +++ b/audio/out/ao_coreaudio.c @@ -312,10 +312,11 @@ static int init(struct ao *ao) talloc_free(layouts); - if (ao->channels.num < 3) - // If the input is not surround or we could not get any usable - // bitmap from the hardware, default to waveext... - mp_chmap_sel_add_waveext(&chmap_sel); + if (ao->channels.num < 3) { + struct mp_chmap chmap; + mp_chmap_from_channels(&chmap, ao->channels.num); + mp_chmap_sel_add_map(&chmap_sel, &chmap); + } if (!ao_chmap_sel_adjust(ao, &chmap_sel, &ao->channels)) { MP_ERR(ao, "could not select a suitable channel map among the "