summaryrefslogtreecommitdiffstats
path: root/audio/out/ao_coreaudio.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-05-07 23:07:14 +0200
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>2015-05-09 21:13:21 +0900
commit1127bb41c2aa4bf60be960ab80fd163bc7011bdb (patch)
treefdec35d47467d4d1f9fa43b727ba96628e0b1c3c /audio/out/ao_coreaudio.c
parentf58646c85c481ea51d74832cb10e5e766e9b4ca9 (diff)
downloadmpv-1127bb41c2aa4bf60be960ab80fd163bc7011bdb.tar.bz2
mpv-1127bb41c2aa4bf60be960ab80fd163bc7011bdb.tar.xz
audio: define only a single NA speaker ID
Remove the requirement from mp_chmap that speaker entries must be unique. Use this to get rid of all the redundant NA speaker IDs. (cherry picked from commit b91b4944bd7ddf6fef4c4254d457117017292c0a)
Diffstat (limited to 'audio/out/ao_coreaudio.c')
-rw-r--r--audio/out/ao_coreaudio.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/audio/out/ao_coreaudio.c b/audio/out/ao_coreaudio.c
index 0b3bc57d1d..a66565d54a 100644
--- a/audio/out/ao_coreaudio.c
+++ b/audio/out/ao_coreaudio.c
@@ -444,7 +444,7 @@ static const int speaker_map[][2] = {
{ kAudioChannelLabel_HeadphonesLeft, MP_SPEAKER_ID_DL },
{ kAudioChannelLabel_HeadphonesRight, MP_SPEAKER_ID_DR },
- { kAudioChannelLabel_Unknown, MP_SPEAKER_ID_NA0 },
+ { kAudioChannelLabel_Unknown, MP_SPEAKER_ID_NA },
{ 0, -1 },
};
@@ -542,14 +542,10 @@ bool ca_layout_to_mp_chmap(struct ao *ao, AudioChannelLayout *layout,
return false;
}
- int next_na = MP_SPEAKER_ID_NA0;
+ int next_na = MP_SPEAKER_ID_NA;
for (int n = 0; n < l->mNumberChannelDescriptions; n++) {
AudioChannelLabel label = l->mChannelDescriptions[n].mChannelLabel;
- uint8_t speaker = ca_label_to_mp_speaker_id(label);
- if (speaker == MP_SPEAKER_ID_NA0 && next_na < MP_SPEAKER_ID_NA_LAST)
- {
- speaker = next_na++;
- }
+ int speaker = ca_label_to_mp_speaker_id(label);
if (speaker < 0) {
MP_VERBOSE(ao, "channel label=%u unusable to build channel "
"bitmap, skipping layout\n", (unsigned) label);