[FFmpeg-soc] [soc]: r2252 - eac3/ac3dec.c

jbr subversion at mplayerhq.hu
Fri May 30 01:28:09 CEST 2008


Author: jbr
Date: Fri May 30 01:28:09 2008
New Revision: 2252

Log:
only skip substream and dependent frames if CRC is ok or unchecked.

Modified:
   eac3/ac3dec.c

Modified: eac3/ac3dec.c
==============================================================================
--- eac3/ac3dec.c	(original)
+++ eac3/ac3dec.c	Fri May 30 01:28:09 2008
@@ -1254,13 +1254,6 @@ static int ac3_decode_frame(AVCodecConte
                 av_log(avctx, AV_LOG_ERROR, "invalid frame size\n");
                 break;
             case AC3_PARSE_ERROR_FRAME_TYPE:
-                /* TODO: add support for substreams and dependent frames */
-                if(s->frame_type == EAC3_FRAME_TYPE_DEPENDENT || s->substreamid) {
-                    av_log(avctx, AV_LOG_ERROR, "unsupported frame type : skipping frame\n");
-                    return s->frame_size;
-                } else {
-                    av_log(avctx, AV_LOG_ERROR, "invalid frame type\n");
-                }
                 break;
             default:
                 av_log(avctx, AV_LOG_ERROR, "invalid header\n");
@@ -1275,13 +1268,21 @@ static int ac3_decode_frame(AVCodecConte
     }
 
     /* check for crc mismatch */
-    if(!err && avctx->error_resilience >= FF_ER_CAREFUL) {
+    if(avctx->error_resilience >= FF_ER_CAREFUL) {
         if(av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, &buf[2], s->frame_size-2)) {
             av_log(avctx, AV_LOG_ERROR, "frame CRC mismatch\n");
             err = 1;
         }
     }
 
+    /* skip frame if CRC is ok. otherwise use error concealment. */
+    /* TODO: add support for substreams and dependent frames */
+    if(err == AC3_PARSE_ERROR_FRAME_TYPE &&
+            (s->frame_type == EAC3_FRAME_TYPE_DEPENDENT || s->substreamid)) {
+        av_log(avctx, AV_LOG_ERROR, "unsupported frame type : skipping frame\n");
+        return s->frame_size;
+    }
+
     /* if frame is ok, set audio parameters */
     if (!err) {
         avctx->sample_rate = s->sample_rate;



More information about the FFmpeg-soc mailing list