avconv: Make sure that inputless filtergraphs are configured
authorLuca Barbato <lu_zero@gentoo.org>
Wed, 3 Aug 2016 02:21:41 +0000 (04:21 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Fri, 12 Aug 2016 09:41:58 +0000 (11:41 +0200)
Unbreak `avconv -filter_complex testsrc`.

Regression introduced in a3a0230a9870b9018dc7415ae5872784d524cfe5

avconv.c

index 43d67e8..59eb300 100644 (file)
--- a/avconv.c
+++ b/avconv.c
@@ -766,6 +766,15 @@ static int poll_filters(void)
         for (i = 0; i < nb_output_streams; i++) {
             int64_t pts = output_streams[i]->sync_opts;
 
+            if (output_streams[i]->filter && !output_streams[i]->filter->graph->graph &&
+                !output_streams[i]->filter->graph->nb_inputs) {
+                ret = configure_filtergraph(output_streams[i]->filter->graph);
+                if (ret < 0) {
+                    av_log(NULL, AV_LOG_ERROR, "Error reinitializing filters!\n");
+                    return ret;
+                }
+            }
+
             if (!output_streams[i]->filter || output_streams[i]->finished ||
                 !output_streams[i]->filter->graph->graph)
                 continue;