[FFmpeg-cvslog] avcodec/adx_parser: make packet split work if nb_channels is set

Paul B Mahol git at videolan.org
Sun Sep 17 12:13:20 EEST 2023


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Tue Sep 12 19:19:08 2023 +0200| [1ac2769009812e1324d44f902e099aa00fd577df] | committer: Paul B Mahol

avcodec/adx_parser: make packet split work if nb_channels is set

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

 libavcodec/adx_parser.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/libavcodec/adx_parser.c b/libavcodec/adx_parser.c
index 52aa14b7ad..62b4415bc1 100644
--- a/libavcodec/adx_parser.c
+++ b/libavcodec/adx_parser.c
@@ -73,6 +73,16 @@ static int adx_parse(AVCodecParserContext *s1,
             s->remaining = 0;
         } else
             s->remaining -= buf_size;
+    } else if (avctx->ch_layout.nb_channels > 0) {
+        if (!s->block_size)
+            s->block_size = avctx->ch_layout.nb_channels * BLOCK_SIZE;
+        if (!s->remaining)
+            s->remaining = s->block_size;
+        if (s->remaining <= buf_size) {
+            next = s->remaining;
+            s->remaining = 0;
+        } else
+            s->remaining -= buf_size;
     }
 
     if (ff_combine_frame(pc, next, &buf, &buf_size) < 0 || !buf_size) {



More information about the ffmpeg-cvslog mailing list