adpcm: simplify reading of Funcom ISS frame header.
authorJustin Ruggles <justin.ruggles@gmail.com>
Sat, 10 Sep 2011 18:21:39 +0000 (14:21 -0400)
committerJustin Ruggles <justin.ruggles@gmail.com>
Thu, 29 Sep 2011 20:54:01 +0000 (16:54 -0400)
libavcodec/adpcm.c

index 80dc7ca..e4e0627 100644 (file)
@@ -593,13 +593,11 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
         }
         break;
     case CODEC_ID_ADPCM_IMA_ISS:
-        c->status[0].predictor  = (int16_t)AV_RL16(src + 0);
-        c->status[0].step_index = src[2];
-        src += 4;
-        if(st) {
-            c->status[1].predictor  = (int16_t)AV_RL16(src + 0);
-            c->status[1].step_index = src[2];
-            src += 4;
+        for (channel = 0; channel < avctx->channels; channel++) {
+            cs = &c->status[channel];
+            cs->predictor  = (int16_t)bytestream_get_le16(&src);
+            cs->step_index = *src++;
+            src++;
         }
 
         while (src < buf + buf_size) {