diff options
Diffstat (limited to 'audio/out')
-rw-r--r-- | audio/out/ao_alsa.c | 9 | ||||
-rw-r--r-- | audio/out/ao_coreaudio_chmap.c | 7 | ||||
-rw-r--r-- | audio/out/ao_sndio.c | 2 |
3 files changed, 5 insertions, 13 deletions
diff --git a/audio/out/ao_alsa.c b/audio/out/ao_alsa.c index e31e8012f8..2a7d694d95 100644 --- a/audio/out/ao_alsa.c +++ b/audio/out/ao_alsa.c @@ -252,7 +252,7 @@ static const int alsa_to_mp_channels[][2] = { {SND_CHMAP_TRR, MP_SP(TBR)}, {SND_CHMAP_TRC, MP_SP(TBC)}, {SND_CHMAP_MONO, MP_SP(FC)}, - {SND_CHMAP_NA, MP_SPEAKER_ID_NA0}, + {SND_CHMAP_NA, MP_SPEAKER_ID_NA}, {SND_CHMAP_LAST, MP_SPEAKER_ID_COUNT} }; @@ -283,14 +283,9 @@ static int mp_chmap_from_alsa(struct mp_chmap *dst, snd_pcm_chmap_t *src) if (src->channels > MP_NUM_CHANNELS) return -1; - int next_na = MP_SPEAKER_ID_NA0; - dst->num = src->channels; - for (int c = 0; c < dst->num; c++) { + for (int c = 0; c < dst->num; c++) dst->speaker[c] = find_mp_channel(src->pos[c]); - if (dst->speaker[c] == MP_SPEAKER_ID_NA0) - dst->speaker[c] = next_na++; - } return 0; } 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); diff --git a/audio/out/ao_sndio.c b/audio/out/ao_sndio.c index bbe616aebf..abce0efd36 100644 --- a/audio/out/ao_sndio.c +++ b/audio/out/ao_sndio.c @@ -99,7 +99,7 @@ static const struct mp_chmap sndio_layouts[MP_NUM_CHANNELS + 1] = { MP_CHMAP8(FL, FR, BL, BR, FC, LFE, SL, SR), // 7.1 /* above is the fixed channel assignment for sndio, since we need to fill all channels and cannot insert silence, not all layouts are supported. - NOTE: MP_SPEAKER_ID_NA0-7 could be used to add padding channels. Keep + NOTE: MP_SPEAKER_ID_NA could be used to add padding channels. Keep in mind that they don't actually contain silence. */ }; |