changeset 6951:4c1b8b50313c libavcodec

use enum value for CRC error
author jbr
date Sat, 31 May 2008 15:31:57 +0000
parents ec4e01cb0089
children 51708e7f3274
files ac3_parser.h ac3dec.c
diffstat 2 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ac3_parser.h	Sat May 31 15:30:55 2008 +0000
+++ b/ac3_parser.h	Sat May 31 15:31:57 2008 +0000
@@ -32,6 +32,7 @@
     AC3_PARSE_ERROR_SAMPLE_RATE = -3,
     AC3_PARSE_ERROR_FRAME_SIZE  = -4,
     AC3_PARSE_ERROR_FRAME_TYPE  = -5,
+    AC3_PARSE_ERROR_CRC         = -6,
 } AC3ParseError;
 
 /**
--- a/ac3dec.c	Sat May 31 15:30:55 2008 +0000
+++ b/ac3dec.c	Sat May 31 15:31:57 2008 +0000
@@ -1157,12 +1157,12 @@
     if(err != AC3_PARSE_ERROR_FRAME_SIZE && 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;
+            err = AC3_PARSE_ERROR_CRC;
         }
     }
 
     /* parse the syncinfo */
-    if(err && err != 1) {
+    if(err && err != AC3_PARSE_ERROR_CRC) {
         switch(err) {
             case AC3_PARSE_ERROR_SYNC:
                 av_log(avctx, AV_LOG_ERROR, "frame sync error\n");