1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-25 08:12:17 +00:00

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.
This commit is contained in:
Stefano Pigozzi 2014-05-08 08:06:10 +02:00
parent 39b316ff06
commit 2a0a13425f

View File

@ -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 "