From b4e598badf848a38d97459eb4f346e700ae7f314 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Tue, 6 May 2014 08:17:38 +0200 Subject: ao_coreaudio: skip unknown channel labels I don't think this is really a very good idea because it is conceptually incorrect but other prominent multimedia programs use this approach (VLC and xbmc), and it seems to make the conversion more robust in certain cases. For example it has been reported, that configuring a receiver that can output 7.1 to output 5.1, will make CoreAudio report 8 channel descriptions, and the last 2 descriptions will be tagged kAudioChannelLabel_Unknown. Fixes #737 --- audio/out/ao_coreaudio_utils.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'audio/out/ao_coreaudio_utils.c') diff --git a/audio/out/ao_coreaudio_utils.c b/audio/out/ao_coreaudio_utils.c index 586e1564ea..11f89422ff 100644 --- a/audio/out/ao_coreaudio_utils.c +++ b/audio/out/ao_coreaudio_utils.c @@ -443,6 +443,8 @@ bool ca_layout_to_mp_chmap(struct ao *ao, AudioChannelLayout *layout, for (int n = 0; n < layout->mNumberChannelDescriptions; n++) { AudioChannelLabel label = layout->mChannelDescriptions[n].mChannelLabel; uint8_t speaker = ca_label_to_mp_speaker_id(label); + if (label == kAudioChannelLabel_Unknown) + continue; if (speaker < 0) { MP_VERBOSE(ao, "channel label=%d unusable to build channel " "bitmap, skipping layout\n", label); -- cgit v1.2.3