diff options
Diffstat (limited to 'contrib/ffmpeg/A14-eac3-request-sample.patch')
-rw-r--r-- | contrib/ffmpeg/A14-eac3-request-sample.patch | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/contrib/ffmpeg/A14-eac3-request-sample.patch b/contrib/ffmpeg/A14-eac3-request-sample.patch new file mode 100644 index 000000000..537653315 --- /dev/null +++ b/contrib/ffmpeg/A14-eac3-request-sample.patch @@ -0,0 +1,87 @@ +From cce0074000cbcbe8f1fb3a9601cfb3ea0a50bc3f Mon Sep 17 00:00:00 2001 +From: Tim Walker <[email protected]> +Date: Fri, 1 Apr 2016 03:05:30 +0200 +Subject: [PATCH 1/2] eac3dec: don't call avpriv_request_sample every frame. + +These errors neither prevent nor stop successful decoding +of the E-AC-3 stream's "core", causing avpriv_request_sample +to be called for every single frame in the bitstream. +--- + libavcodec/ac3dec.h | 2 ++ + libavcodec/eac3dec.c | 10 ++++++++-- + 2 files changed, 10 insertions(+), 2 deletions(-) + +diff --git a/libavcodec/ac3dec.h b/libavcodec/ac3dec.h +index babd0a7..2468f5a 100644 +--- a/libavcodec/ac3dec.h ++++ b/libavcodec/ac3dec.h +@@ -92,6 +92,8 @@ typedef struct AC3DecodeContext { + int lfe_mix_level_exists; ///< indicates if lfemixlevcod is specified (lfemixlevcode) + int lfe_mix_level; ///< LFE mix level index (lfemixlevcod) + int eac3; ///< indicates if current frame is E-AC-3 ++ int eac3_frame_dependent_found; ///< bitstream has E-AC-3 dependent frame(s) ++ int eac3_subsbtreamid_found; ///< bitstream has E-AC-3 additional substream(s) + int dolby_surround_mode; ///< dolby surround mode (dsurmod) + int dolby_surround_ex_mode; ///< dolby surround ex mode (dsurexmod) + int dolby_headphone_mode; ///< dolby headphone mode (dheadphonmod) +diff --git a/libavcodec/eac3dec.c b/libavcodec/eac3dec.c +index b9d079c..fe52d27 100644 +--- a/libavcodec/eac3dec.c ++++ b/libavcodec/eac3dec.c +@@ -300,7 +300,10 @@ int ff_eac3_parse_header(AC3DecodeContext *s) + application can select from. each independent stream can also contain + dependent streams which are used to add or replace channels. */ + if (s->frame_type == EAC3_FRAME_TYPE_DEPENDENT) { +- avpriv_request_sample(s->avctx, "Dependent substream decoding"); ++ if (!s->eac3_frame_dependent_found) { ++ s->eac3_frame_dependent_found = 1; ++ avpriv_request_sample(s->avctx, "Dependent substream decoding"); ++ } + return AAC_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"); +@@ -312,7 +315,10 @@ int ff_eac3_parse_header(AC3DecodeContext *s) + associated to an independent stream have matching substream id's. */ + if (s->substreamid) { + /* only decode substream with id=0. skip any additional substreams. */ +- avpriv_request_sample(s->avctx, "Additional substreams"); ++ if (!s->eac3_subsbtreamid_found) { ++ s->eac3_subsbtreamid_found = 1; ++ avpriv_request_sample(s->avctx, "Additional substreams"); ++ } + return AAC_AC3_PARSE_ERROR_FRAME_TYPE; + } + +-- +2.5.4 (Apple Git-61) + + +From bea249d14da03d249c78cb4dffc5d88121f3caa2 Mon Sep 17 00:00:00 2001 +From: Tim Walker <[email protected]> +Date: Fri, 1 Apr 2016 03:16:09 +0200 +Subject: [PATCH 2/2] ac3dec: change logging of skipped E-AC-3 substreams. + +Change log level from warning to debug: the E-AC-3 "core" +substream can be successfully decoded without the additional +and dependent substreams, and their presence is already +indicated via avpriv_request_sample in ff_eac3_parse_header. +--- + libavcodec/ac3dec.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c +index 4876ac0..02d02b2 100644 +--- a/libavcodec/ac3dec.c ++++ b/libavcodec/ac3dec.c +@@ -1355,7 +1355,7 @@ static int ac3_decode_frame(AVCodecContext * avctx, void *data, + /* 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_WARNING, "unsupported frame type : " ++ av_log(avctx, AV_LOG_DEBUG, "unsupported frame type : " + "skipping frame\n"); + *got_frame_ptr = 0; + return buf_size; +-- +2.5.4 (Apple Git-61) + |