[FFmpeg-cvslog] alsdec: change channel sorting so it match reference implementation
Paul B Mahol
git at videolan.org
Sat Jan 5 10:38:22 CET 2013
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Thu Jan 3 18:37:32 2013 +0000| [d4211c47220c97df2751c11092fe343b6c82db65] | committer: Paul B Mahol
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 at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d4211c47220c97df2751c11092fe343b6c82db65
---
libavcodec/alsdec.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index 9d80ea9..8b9c2ee 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);
More information about the ffmpeg-cvslog
mailing list