diff mbox series

[FFmpeg-devel,10/11] fftools/ffmpeg_filter: use InputFilterPriv.eof instead of InputFile.eof_reached

Message ID 20230505090723.24872-10-anton@khirnov.net
State Accepted
Commit a0174a235b08f1bc26c7aee25b385d2dd997f8db
Headers show
Series [FFmpeg-devel,01/11] fftools/ffmpeg: merge choose_output() and got_eagain() | 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 May 5, 2023, 9:07 a.m. UTC
The two checks using eof_reached are testing whether more input can
possibly appear on this filtergraph input. InputFilterPriv.eof is the
more authoritative source for this information.
---
 fftools/ffmpeg_filter.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index 634315fa34..aea951a2da 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -1620,7 +1620,6 @@  int fg_transcode_step(FilterGraph *graph, InputStream **best_ist)
 {
     int i, ret;
     int nb_requests, nb_requests_max = 0;
-    InputFilter *ifilter;
     InputStream *ist;
 
     if (!graph->graph && ifilter_has_all_input_formats(graph)) {
@@ -1637,7 +1636,8 @@  int fg_transcode_step(FilterGraph *graph, InputStream **best_ist)
     if (!graph->graph) {
         for (int i = 0; i < graph->nb_inputs; i++) {
             InputFilter *ifilter = graph->inputs[i];
-            if (!ifilter->ist->got_output && !input_files[ifilter->ist->file_index]->eof_reached) {
+            InputFilterPriv *ifp = ifp_from_ifilter(ifilter);
+            if (!ifilter->ist->got_output && !ifp->eof) {
                 *best_ist = ifilter->ist;
                 return 0;
             }
@@ -1665,10 +1665,11 @@  int fg_transcode_step(FilterGraph *graph, InputStream **best_ist)
         return ret;
 
     for (i = 0; i < graph->nb_inputs; i++) {
-        ifilter = graph->inputs[i];
+        InputFilter *ifilter = graph->inputs[i];
+        InputFilterPriv *ifp = ifp_from_ifilter(ifilter);
+
         ist = ifilter->ist;
-        if (input_files[ist->file_index]->eagain ||
-            input_files[ist->file_index]->eof_reached)
+        if (input_files[ist->file_index]->eagain || ifp->eof)
             continue;
         nb_requests = av_buffersrc_get_nb_failed_requests(ifilter->filter);
         if (nb_requests > nb_requests_max) {