diff mbox series

[FFmpeg-devel] fftools/ffmpeg_filter: do not assume av_buffersrc_get_nb_failed_requests()>0

Message ID 20240307143418.17071-1-anton@khirnov.net
State Accepted
Commit ce178be8b0caf3255ceeeff14a8c3619dac5cc8a
Headers show
Series [FFmpeg-devel] fftools/ffmpeg_filter: do not assume av_buffersrc_get_nb_failed_requests()>0 | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Anton Khirnov March 7, 2024, 2:34 p.m. UTC
Apparently it can happen that avfilter_graph_request_oldest() returns
EAGAIN, yet av_buffersrc_get_nb_failed_requests() returns 0 for every
input.

Fixes #10795
---
 fftools/ffmpeg_filter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index 13c5065191..dc7131c154 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -1889,7 +1889,7 @@  static void send_command(FilterGraph *fg, AVFilterGraph *graph,
 
 static int choose_input(const FilterGraph *fg, const FilterGraphThread *fgt)
 {
-    int nb_requests, nb_requests_max = 0;
+    int nb_requests, nb_requests_max = -1;
     int best_input = -1;
 
     for (int i = 0; i < fg->nb_inputs; i++) {