diff options
author | wm4 <wm4@nowhere> | 2015-05-07 23:07:14 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-05-07 23:07:14 +0200 |
commit | b91b4944bd7ddf6fef4c4254d457117017292c0a (patch) | |
tree | 9df3f41d12fe7dc3599d1a0794e1b2b2eb9f1b5e /audio/out/ao_alsa.c | |
parent | 34770887410cab45e2779d43a83aa4f6bdecf926 (diff) | |
download | mpv-b91b4944bd7ddf6fef4c4254d457117017292c0a.tar.bz2 mpv-b91b4944bd7ddf6fef4c4254d457117017292c0a.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.
Diffstat (limited to 'audio/out/ao_alsa.c')
-rw-r--r-- | audio/out/ao_alsa.c | 9 |
1 files changed, 2 insertions, 7 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; } |