[FFmpeg-cvslog] adpcm: ADPCM Electronic Arts has always two channels

Janne Grunau git at videolan.org
Fri Jan 6 02:53:08 CET 2012


ffmpeg | branch: master | Janne Grunau <janne-libav at jannau.net> | Thu Jan  5 20:50:55 2012 +0100| [bb5b3940b08d8dad5b7e948e8f3b02cd2eb70716] | committer: Janne Grunau

adpcm: ADPCM Electronic Arts has always two channels

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bb5b3940b08d8dad5b7e948e8f3b02cd2eb70716
---

 libavcodec/adpcm.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index 2081ef6..b319635 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -91,9 +91,13 @@ typedef struct ADPCMDecodeContext {
 static av_cold int adpcm_decode_init(AVCodecContext * avctx)
 {
     ADPCMDecodeContext *c = avctx->priv_data;
+    unsigned int min_channels = 1;
     unsigned int max_channels = 2;
 
     switch(avctx->codec->id) {
+    case CODEC_ID_ADPCM_EA:
+        min_channels = 2;
+        break;
     case CODEC_ID_ADPCM_EA_R1:
     case CODEC_ID_ADPCM_EA_R2:
     case CODEC_ID_ADPCM_EA_R3:
@@ -101,7 +105,7 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx)
         max_channels = 6;
         break;
     }
-    if (avctx->channels <= 0 || avctx->channels > max_channels) {
+    if (avctx->channels < min_channels || avctx->channels > max_channels) {
         av_log(avctx, AV_LOG_ERROR, "Invalid number of channels\n");
         return AVERROR(EINVAL);
     }



More information about the ffmpeg-cvslog mailing list