diff options
author | Paul B Mahol <onemda@gmail.com> | 2013-01-03 18:37:32 +0000 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2013-01-05 09:36:14 +0000 |
commit | d4211c47220c97df2751c11092fe343b6c82db65 (patch) | |
tree | ce57a63f0dfd5ad40ce3fec55a93f49663fc398f /libavcodec | |
parent | 014056635944b7b22cd25aef44f0cdc4c237e9b6 (diff) | |
download | ffmpeg-d4211c47220c97df2751c11092fe343b6c82db65.tar.gz |
alsdec: change channel sorting so it match reference implementation
Read channel source instead of channel target for channel sorting.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/alsdec.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c index 9d80ea9440..8b9c2eecac 100644 --- a/libavcodec/alsdec.c +++ b/libavcodec/alsdec.c @@ -356,12 +356,15 @@ static av_cold int read_specific_config(ALSDecContext *ctx) return AVERROR(ENOMEM); for (i = 0; i < avctx->channels; i++) { - sconf->chan_pos[i] = get_bits(&gb, chan_pos_bits); - if (sconf->chan_pos[i] >= avctx->channels) { + int idx; + + idx = get_bits(&gb, chan_pos_bits); + if (idx >= avctx->channels) { av_log(avctx, AV_LOG_WARNING, "Invalid channel reordering.\n"); sconf->chan_sort = 0; break; } + sconf->chan_pos[idx] = i; } align_get_bits(&gb); |