[FFmpeg-cvslog] Merge commit 'fef2147b7a689b80d716c3edb9d4a18904865275'

Derek Buitenhuis git at videolan.org
Mon May 9 00:08:07 CEST 2016


ffmpeg | branch: master | Derek Buitenhuis <derek.buitenhuis at gmail.com> | Sun May  8 23:05:12 2016 +0100| [15cb52577a8426b0a1253b8a4c655308f3ef4ba1] | committer: Derek Buitenhuis

Merge commit 'fef2147b7a689b80d716c3edb9d4a18904865275'

* commit 'fef2147b7a689b80d716c3edb9d4a18904865275':
  eac3dec: don't call avpriv_request_sample every frame.

Merged-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=15cb52577a8426b0a1253b8a4c655308f3ef4ba1
---

 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 b3498fe..c2b867e 100644
--- a/libavcodec/ac3dec.h
+++ b/libavcodec/ac3dec.h
@@ -96,6 +96,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 ef815af..47e5aa6 100644
--- a/libavcodec/eac3dec.c
+++ b/libavcodec/eac3dec.c
@@ -305,7 +305,10 @@ static 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");
@@ -317,7 +320,10 @@ static 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;
     }
 


======================================================================




More information about the ffmpeg-cvslog mailing list