From: ngaullier via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: ngaullier <code@ffmpeg.org>
Subject: [FFmpeg-devel] [PATCH] avfilter/src_movie: fix support multiple frames per packet (PR #21318)
Date: Tue, 30 Dec 2025 09:52:31 -0000
Message-ID: <176708835240.25.15882030805044540504@4457048688e7> (raw)
PR #21318 opened by ngaullier
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21318
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21318.patch
Fixes #20827.
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
>From 26ac8a2c0719c3cc60e9d965b6021a314e219e24 Mon Sep 17 00:00:00 2001
From: Nicolas Gaullier <nicolas.gaullier@cji.paris>
Date: Mon, 29 Dec 2025 18:51:01 +0100
Subject: [PATCH] avfilter/src_movie: fix support multiple frames per packet
Fixes #20827.
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris>
---
libavfilter/src_movie.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/libavfilter/src_movie.c b/libavfilter/src_movie.c
index adb21e019e..ae2e74c1b6 100644
--- a/libavfilter/src_movie.c
+++ b/libavfilter/src_movie.c
@@ -519,7 +519,7 @@ static int decode_packet(AVFilterContext *ctx, int i)
AVCodecContext *dec = movie->st[i].codec_ctx;
AVFrame *frame = movie->st[i].frame;
AVPacket *pkt = movie->pkt;
- int ret = 0;
+ int ret = 0, has_frame = 0;
// submit the packet to the decoder
if (!movie->eof) {
@@ -529,15 +529,16 @@ static int decode_packet(AVFilterContext *ctx, int i)
}
// get all the available frames from the decoder
- if (ret >= 0) {
+ while (ret >= 0) {
ret = avcodec_receive_frame(dec, frame);
if (ret < 0) {
// those two return values are special and mean there is no output
// frame available, but there were no errors during decoding
if (ret == AVERROR_EOF || ret == AVERROR(EAGAIN))
- return 0;
+ return has_frame;
return ret;
}
+ has_frame |= 1;
frame->pts = frame->best_effort_timestamp;
if (frame->pts != AV_NOPTS_VALUE) {
@@ -558,8 +559,6 @@ static int decode_packet(AVFilterContext *ctx, int i)
ret = ff_filter_frame(outlink, av_frame_clone(frame));
if (ret < 0)
return ret;
- if (ret == 0)
- return 1;
}
return 0;
--
2.49.1
_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org
reply other threads:[~2025-12-30 9:53 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=176708835240.25.15882030805044540504@4457048688e7 \
--to=ffmpeg-devel@ffmpeg.org \
--cc=code@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git