[FFmpeg-cvslog] avcodec/mlpdec: skip decoding substreams if their channels are not to be used

Paul B Mahol git at videolan.org
Sun Oct 3 12:47:51 EEST 2021


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Mon Sep  6 23:56:48 2021 +0200| [17130321f3faaa01c7360f904229c7b9b4410703] | committer: Paul B Mahol

avcodec/mlpdec: skip decoding substreams if their channels are not to be used

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

 libavcodec/mlpdec.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c
index d56e214e1e..68c270ef52 100644
--- a/libavcodec/mlpdec.c
+++ b/libavcodec/mlpdec.c
@@ -1249,6 +1249,12 @@ static int read_access_unit(AVCodecContext *avctx, void* data,
 
     for (substr = 0; substr <= m->max_decoded_substream; substr++) {
         SubStream *s = &m->substream[substr];
+
+        if (substr != m->max_decoded_substream &&
+            m->substream[m->max_decoded_substream].min_channel == 0 &&
+            m->substream[m->max_decoded_substream].max_channel == avctx->channels - 1)
+            goto skip_substr;
+
         init_get_bits(&gb, buf, substream_data_len[substr] * 8);
 
         m->matrix_changed = 0;
@@ -1322,6 +1328,7 @@ next_substr:
             av_log(m->avctx, AV_LOG_ERROR,
                    "No restart header present in substream %d.\n", substr);
 
+skip_substr:
         buf += substream_data_len[substr];
     }
 



More information about the ffmpeg-cvslog mailing list