diff options
author | wm4 <wm4@nowhere> | 2015-03-15 17:07:06 +0100 |
---|---|---|
committer | Diogo Franco (Kovensky) <diogomfranco@gmail.com> | 2015-03-16 17:08:01 +0900 |
commit | c5a8fc793cb24a0eb77f0975640c093160ca8a9d (patch) | |
tree | 6fdcdebbe4c903fe993d8e39aebb3db9dbec6ac7 | |
parent | 3dcd3476c664e514e36643e62d319da29f19d2ac (diff) | |
download | mpv-c5a8fc793cb24a0eb77f0975640c093160ca8a9d.tar.bz2 mpv-c5a8fc793cb24a0eb77f0975640c093160ca8a9d.tar.xz |
audio: fix off by one error in channel map selection code
The consequence was that some AOs (like ao_jack) could not output 8
channels.
Fixes #1688.
(cherry picked from commit c4f4b0901496411c93647e36042128b08f5d153d)
-rw-r--r-- | audio/chmap_sel.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/audio/chmap_sel.c b/audio/chmap_sel.c index 23ebe71710..515190e14d 100644 --- a/audio/chmap_sel.c +++ b/audio/chmap_sel.c @@ -74,7 +74,7 @@ void mp_chmap_sel_add_waveext(struct mp_chmap_sel *s) // Classic ALSA-based MPlayer layouts. void mp_chmap_sel_add_alsa_def(struct mp_chmap_sel *s) { - for (int n = 0; n < MP_NUM_CHANNELS; n++) { + for (int n = 1; n <= MP_NUM_CHANNELS; n++) { struct mp_chmap t; mp_chmap_from_channels_alsa(&t, n); if (t.num) @@ -102,7 +102,7 @@ void mp_chmap_sel_add_map(struct mp_chmap_sel *s, const struct mp_chmap *map) // Allow all waveext formats in default order. void mp_chmap_sel_add_waveext_def(struct mp_chmap_sel *s) { - for (int n = 1; n < MP_NUM_CHANNELS; n++) { + for (int n = 1; n <= MP_NUM_CHANNELS; n++) { struct mp_chmap map; mp_chmap_from_channels(&map, n); mp_chmap_sel_add_map(s, &map); |