[FFmpeg-cvslog] ffmpeg: do not finish output streams manually on eof even if no input is provided

Marton Balint git at videolan.org
Thu Mar 29 01:20:47 EEST 2018


ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Sun Mar 18 18:34:23 2018 +0100| [0031eab61c82af7fca3aff4ced82c6ab9eb4e786] | committer: Marton Balint

ffmpeg: do not finish output streams manually on eof even if no input is provided

The generic code should be able to finish the streams just fine initializing
and flushing the filters and codecs properly.

Fixes the following command:

ffmpeg -f lavfi -i "testsrc=d=0.1[out0];aevalsrc=0:d=0[out1]" -af apad -shortest -f framecrc -

Signed-off-by: Marton Balint <cus at passwd.hu>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0031eab61c82af7fca3aff4ced82c6ab9eb4e786
---

 fftools/ffmpeg.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index b72884673d..4fcce8e204 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -2188,7 +2188,7 @@ static int ifilter_send_frame(InputFilter *ifilter, AVFrame *frame)
 
 static int ifilter_send_eof(InputFilter *ifilter, int64_t pts)
 {
-    int i, j, ret;
+    int ret;
 
     ifilter->eof = 1;
 
@@ -2205,16 +2205,6 @@ static int ifilter_send_eof(InputFilter *ifilter, int64_t pts)
             av_log(NULL, AV_LOG_ERROR, "Cannot determine format of input stream %d:%d after EOF\n", ifilter->ist->file_index, ifilter->ist->st->index);
             return AVERROR_INVALIDDATA;
         }
-        for (i = 0; i < fg->nb_inputs; i++)
-            if (!fg->inputs[i]->eof)
-                break;
-        if (i == fg->nb_inputs) {
-            // All the input streams have finished without the filtergraph
-            // ever being configured.
-            // Mark the output streams as finished.
-            for (j = 0; j < fg->nb_outputs; j++)
-                finish_output_stream(fg->outputs[j]->ost);
-        }
     }
 
     return 0;



More information about the ffmpeg-cvslog mailing list