summaryrefslogtreecommitdiff
path: root/avconv_opt.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-05-23 14:09:08 +0200
committerAnton Khirnov <anton@khirnov.net>2016-05-30 17:08:56 +0200
commit45e169e90863540ddd3e7630d7bacb4130b6e2eb (patch)
tree0a5b1d573598dd482201f2e2eca3ab484cb954e4 /avconv_opt.c
parent2546bf2ae62703211342593ff71381c5fd0648db (diff)
avconv: decouple configuring filtergraphs and setting input parameters
Currently, calling configure_filtergraph() will pull in the input parameters from the corresponding decoder context. This has the following disadvantages: - the decoded frame is a more proper source for this information - a filter accessing decoder data breaks proper layering Add functions for explicitly sending the input stream parameters to a filtergraph input - currently from a frame and a decoder. The decoder one will be dropped in future commits after some more restructuring.
Diffstat (limited to 'avconv_opt.c')
-rw-r--r--avconv_opt.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/avconv_opt.c b/avconv_opt.c
index e966e49061..df56c0646c 100644
--- a/avconv_opt.c
+++ b/avconv_opt.c
@@ -1494,12 +1494,28 @@ static int init_complex_filters(void)
static int configure_complex_filters(void)
{
- int i, ret = 0;
+ int i, j, ret = 0;
+
+ for (i = 0; i < nb_filtergraphs; i++) {
+ FilterGraph *fg = filtergraphs[i];
+
+ if (filtergraph_is_simple(fg))
+ continue;
- for (i = 0; i < nb_filtergraphs; i++)
- if (!filtergraph_is_simple(filtergraphs[i]) &&
- (ret = configure_filtergraph(filtergraphs[i])) < 0)
+ for (j = 0; j < fg->nb_inputs; j++) {
+ ret = ifilter_parameters_from_decoder(fg->inputs[j],
+ fg->inputs[j]->ist->dec_ctx);
+ if (ret < 0) {
+ av_log(NULL, AV_LOG_ERROR,
+ "Error initializing filtergraph %d input %d\n", i, j);
+ return ret;
+ }
+ }
+
+ ret = configure_filtergraph(filtergraphs[i]);
+ if (ret < 0)
return ret;
+ }
return 0;
}