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
This commit is contained in:
Stefano Pigozzi 2014-05-06 08:17:38 +02:00
parent 1a4f4f80bf
commit b4e598badf
1 changed files with 2 additions and 0 deletions

View File

@ -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);