From d93a9be656ed4e3e5b953b0de3e40584e8ec8eba Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 21 Oct 2015 18:57:03 +0200 Subject: ao_coreaudio: do not accept unknown channel layouts Coreaudio gives us a channel map with all entries set to kAudioChannelLabel_Unknown. This is translated to a mpv channel map with all channels set to NA, which has special meaning: it's an "unknown" channel map, which acts as wildcard and can be converted from/to any channel layout. Not really what we want. I've got this with USB audio, playing stereo. The multichannel layout consisted of 2 unknown channels, while the stereo channel map was stereo (as expected). Note that channel maps with _some_ NA entries are not affected by this, and must still work. --- audio/out/ao_coreaudio_chmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'audio/out/ao_coreaudio_chmap.c') diff --git a/audio/out/ao_coreaudio_chmap.c b/audio/out/ao_coreaudio_chmap.c index 0405338828..a034a01668 100644 --- a/audio/out/ao_coreaudio_chmap.c +++ b/audio/out/ao_coreaudio_chmap.c @@ -164,7 +164,7 @@ static bool ca_layout_to_mp_chmap(struct ao *ao, AudioChannelLayout *layout, } talloc_free(talloc_ctx); - return chmap->num > 0; + return mp_chmap_is_valid(chmap) && !mp_chmap_is_unknown(chmap); coreaudio_error: MP_VERBOSE(ao, "converted input channel layout (failed):\n"); ca_log_layout(ao, MSGL_V, layout); -- cgit v1.2.3