ffmpeg: do not finish output streams manually on eof even if no input is provided
authorMarton Balint <cus@passwd.hu>
Sun, 18 Mar 2018 17:34:23 +0000 (18:34 +0100)
committerMarton Balint <cus@passwd.hu>
Wed, 28 Mar 2018 22:07:39 +0000 (00:07 +0200)
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@passwd.hu>
fftools/ffmpeg.c

index b728846..4fcce8e 100644 (file)
@@ -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;