summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2014-05-06 08:17:38 +0200
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2014-05-10 14:07:45 +0200
commitb4e598badf848a38d97459eb4f346e700ae7f314 (patch)
treed8a1e3bdd96f4b2caf089b1d6413198298797cbf
parent1a4f4f80bf06e6d0a25aabb15adfd15062417991 (diff)
downloadmpv-b4e598badf848a38d97459eb4f346e700ae7f314.tar.bz2
mpv-b4e598badf848a38d97459eb4f346e700ae7f314.tar.xz
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
-rw-r--r--audio/out/ao_coreaudio_utils.c2
1 files changed, 2 insertions, 0 deletions
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);