aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/adx_parser.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2023-09-12 19:19:08 +0200
committerPaul B Mahol <onemda@gmail.com>2023-09-17 11:11:24 +0200
commit1ac2769009812e1324d44f902e099aa00fd577df (patch)
treef5f685368c32c33884733c5b93e78cc6ae0b53e3 /libavcodec/adx_parser.c
parentc5effe7d3db6610e9ec5a1efbe11d2b87bb34d61 (diff)
downloadffmpeg-1ac2769009812e1324d44f902e099aa00fd577df.tar.gz
avcodec/adx_parser: make packet split work if nb_channels is set
Diffstat (limited to 'libavcodec/adx_parser.c')
-rw-r--r--libavcodec/adx_parser.c10
1 files changed, 10 insertions, 0 deletions
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) {