mirror of https://github.com/mpv-player/mpv
audio: fix fallback if audio API does not support mono
This makes it fallback to stereo properly.
This commit is contained in:
parent
f88a86a936
commit
8def7ccb4f
|
@ -184,12 +184,11 @@ bool mp_chmap_sel_adjust(const struct mp_chmap_sel *s, struct mp_chmap *map)
|
|||
}
|
||||
}
|
||||
// Fallback to mono/stereo as last resort
|
||||
if (map->num == 1) {
|
||||
*map = (struct mp_chmap) MP_CHMAP_INIT_MONO;
|
||||
} else if (map->num >= 2) {
|
||||
*map = (struct mp_chmap) MP_CHMAP_INIT_STEREO;
|
||||
}
|
||||
if (test_layout(s, map))
|
||||
*map = (struct mp_chmap) MP_CHMAP_INIT_MONO;
|
||||
if (map->num == 1 && test_layout(s, map))
|
||||
return true;
|
||||
*map = (struct mp_chmap) MP_CHMAP_INIT_STEREO;
|
||||
if (map->num >= 2 && test_layout(s, map))
|
||||
return true;
|
||||
*map = (struct mp_chmap) {0};
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue