changeset 7014:24ddcb54f147 libavcodec

skip unsupported frame types and substream id's
author jbr
date Sat, 07 Jun 2008 22:29:27 +0000
parents d07912ff7dcd
children d9ac2c5a5d89
files ac3dec.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ac3dec.c	Sat Jun 07 22:29:19 2008 +0000
+++ b/ac3dec.c	Sat Jun 07 22:29:27 2008 +0000
@@ -1175,7 +1175,14 @@
                 av_log(avctx, AV_LOG_ERROR, "invalid frame size\n");
                 break;
             case AC3_PARSE_ERROR_FRAME_TYPE:
+                /* skip frame if CRC is ok. otherwise use error concealment. */
+                /* 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");