Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] avfilter/src_movie: fix support multiple frames per packet (PR #21318)
@ 2025-12-30  9:52 ngaullier via ffmpeg-devel
  0 siblings, 0 replies; only message in thread
From: ngaullier via ffmpeg-devel @ 2025-12-30  9:52 UTC (permalink / raw)
  To: ffmpeg-devel; +Cc: ngaullier

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-12-30  9:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-30  9:52 [FFmpeg-devel] [PATCH] avfilter/src_movie: fix support multiple frames per packet (PR #21318) ngaullier via ffmpeg-devel

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