]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/s302m.c
ffplay: remove unnecessary if (cur_stream) checks
[ffmpeg] / libavcodec / s302m.c
index d8b2b38a028b65cfa502cdfaa85fc640870444cd..4db18eb2d0e248896b02b2b9d8eb1a0c14ffef1c 100644 (file)
@@ -29,7 +29,7 @@ static int s302m_parse_frame_header(AVCodecContext *avctx, const uint8_t *buf,
                                     int buf_size)
 {
     uint32_t h;
-    int frame_size, channels, id, bits;
+    int frame_size, channels, bits;
 
     if (buf_size <= AES3_HEADER_LEN) {
         av_log(avctx, AV_LOG_ERROR, "frame is too short\n");
@@ -48,7 +48,6 @@ static int s302m_parse_frame_header(AVCodecContext *avctx, const uint8_t *buf,
     h = AV_RB32(buf);
     frame_size =  (h >> 16) & 0xffff;
     channels   = ((h >> 14) & 0x0003) * 2 +  2;
-    id         =  (h >>  6) & 0x00ff;
     bits       = ((h >>  4) & 0x0003) * 4 + 16;
 
     if (AES3_HEADER_LEN + frame_size != buf_size || bits > 24) {
@@ -59,9 +58,9 @@ static int s302m_parse_frame_header(AVCodecContext *avctx, const uint8_t *buf,
     /* Set output properties */
     avctx->bits_per_coded_sample = bits;
     if (bits > 16)
-        avctx->sample_fmt = SAMPLE_FMT_S32;
+        avctx->sample_fmt = AV_SAMPLE_FMT_S32;
     else
-        avctx->sample_fmt = SAMPLE_FMT_S16;
+        avctx->sample_fmt = AV_SAMPLE_FMT_S16;
 
     avctx->channels    = channels;
     switch(channels) {
@@ -108,7 +107,7 @@ static int s302m_decode_frame(AVCodecContext *avctx, void *data,
             *o++ = (av_reverse[buf[6] & 0xf0] << 28) |
                    (av_reverse[buf[5]]        << 20) |
                    (av_reverse[buf[4]]        << 12) |
-                   (av_reverse[buf[3] & 0x0f] <<  8);
+                   (av_reverse[buf[3] & 0x0f] <<  4);
             buf += 7;
         }
         *data_size = (uint8_t*) o - (uint8_t*) data;
@@ -131,7 +130,7 @@ static int s302m_decode_frame(AVCodecContext *avctx, void *data,
                     av_reverse[buf[0]];
             *o++ = (av_reverse[buf[4] & 0xf0] << 12) |
                    (av_reverse[buf[3]]        <<  4) |
-                    av_reverse[buf[2] & 0x0f];
+                   (av_reverse[buf[2]]        >>  4);
             buf += 5;
         }
         *data_size = (uint8_t*) o - (uint8_t*) data;