mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-05 14:30:00 +01:00
libavcodec/opus/parser: Fix spurious 'Error parsing Opus packet header'
When PARSER_FLAG_COMPLETE_FRAMES is set, opus_parse() calls set_frame_duration even on flush (buf_size==0), which triggers a spurious "Error parsing Opus packet header" at EOF. Match streaming-path behavior by skipping duration parsing on empty buffers. Fixes #20954
This commit is contained in:
@@ -189,7 +189,7 @@ static int opus_parse(AVCodecParserContext *ctx, AVCodecContext *avctx,
|
||||
if (ctx->flags & PARSER_FLAG_COMPLETE_FRAMES) {
|
||||
next = buf_size;
|
||||
|
||||
if (set_frame_duration(ctx, avctx, buf, buf_size) < 0)
|
||||
if (buf_size && set_frame_duration(ctx, avctx, buf, buf_size) < 0)
|
||||
goto fail;
|
||||
} else {
|
||||
next = opus_find_frame_end(ctx, avctx, buf, buf_size, &header_len);
|
||||
|
||||
Reference in New Issue
Block a user