From b91b4944bd7ddf6fef4c4254d457117017292c0a Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 7 May 2015 23:07:14 +0200 Subject: 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. --- audio/out/ao_coreaudio_chmap.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (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 f50bf4f3cc..8da0c4c6f0 100644 --- a/audio/out/ao_coreaudio_chmap.c +++ b/audio/out/ao_coreaudio_chmap.c @@ -51,7 +51,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 }, }; @@ -150,12 +150,9 @@ static bool ca_layout_to_mp_chmap(struct ao *ao, AudioChannelLayout *layout, return false; } - int next_na = MP_SPEAKER_ID_NA0; 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); -- cgit v1.2.3