[FFmpeg-soc] [soc]: r2246 - in eac3: ac3dec.c eac3dec.c

jbr subversion at mplayerhq.hu
Fri May 30 00:58:53 CEST 2008


Author: jbr
Date: Fri May 30 00:58:53 2008
New Revision: 2246

Log:
skip dependent frames

Modified:
   eac3/ac3dec.c
   eac3/eac3dec.c

Modified: eac3/ac3dec.c
==============================================================================
--- eac3/ac3dec.c	(original)
+++ eac3/ac3dec.c	Fri May 30 00:58:53 2008
@@ -1266,10 +1266,16 @@ 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 dependent frames */
+                if(s->frame_type == EAC3_FRAME_TYPE_DEPENDENT) {
+                    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");
+                av_log(avctx, AV_LOG_ERROR, "invalid header : error %d\n", err);
                 break;
         }
     }

Modified: eac3/eac3dec.c
==============================================================================
--- eac3/eac3dec.c	(original)
+++ eac3/eac3dec.c	Fri May 30 00:58:53 2008
@@ -21,6 +21,7 @@
 
 #include "avcodec.h"
 #include "ac3.h"
+#include "ac3_parser.h"
 #include "ac3dec.h"
 
 /** Channel gain adaptive quantization mode */
@@ -279,10 +280,10 @@ static int parse_bsi(AC3DecodeContext *s
     s->frame_type = get_bits(gbc, 2);
     if (s->frame_type == EAC3_FRAME_TYPE_DEPENDENT) {
         ff_eac3_log_missing_feature(s->avctx, "Dependent substream");
-        return -1;
+        return AC3_PARSE_ERROR_FRAME_TYPE;
     } else if (s->frame_type == EAC3_FRAME_TYPE_RESERVED) {
         av_log(s->avctx, AV_LOG_ERROR, "Reserved frame type\n");
-        return -1;
+        return AC3_PARSE_ERROR_FRAME_TYPE;
     }
 
     /* the substream id indicates which substream this frame belongs to. each
@@ -626,7 +627,10 @@ static int parse_audfrm(AC3DecodeContext
 
 int ff_eac3_parse_header(AC3DecodeContext *s)
 {
-    return (parse_bsi(s) || parse_audfrm(s));
+    int err = parse_bsi(s);
+    if(!err)
+        err = parse_audfrm(s);
+    return err;
 }
 
 #if 0



More information about the FFmpeg-soc mailing list