summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-05-22 17:57:59 +0200
committerAnton Khirnov <anton@khirnov.net>2016-05-30 17:08:55 +0200
commitf8bb83cd3e60ee57de6831b27f154d41549896a3 (patch)
tree3bb2967d69f742ae907108af4dcd318246837471
parentefcd17ed092c1cb2382f56c5d6f12e383adf2c48 (diff)
avconv: add a function for determining whether a filtergraph is simple
This makes the code easier to read.
-rw-r--r--avconv.c4
-rw-r--r--avconv.h1
-rw-r--r--avconv_filter.c6
3 files changed, 8 insertions, 3 deletions
diff --git a/avconv.c b/avconv.c
index d8631036a1..df1471428c 100644
--- a/avconv.c
+++ b/avconv.c
@@ -2120,7 +2120,7 @@ static int transcode_init(void)
ist = input_streams[i];
for (j = 0; j < ist->nb_filters; j++) {
- if (ist->filters[j]->graph->graph_desc) {
+ if (!filtergraph_is_simple(ist->filters[j]->graph)) {
av_log(NULL, AV_LOG_INFO, " Stream #%d:%d (%s) -> %s",
ist->file_index, ist->st->index, ist->dec ? ist->dec->name : "?",
ist->filters[j]->name);
@@ -2141,7 +2141,7 @@ static int transcode_init(void)
continue;
}
- if (ost->filter && ost->filter->graph->graph_desc) {
+ if (ost->filter && !filtergraph_is_simple(ost->filter->graph)) {
/* output from a complex graph */
av_log(NULL, AV_LOG_INFO, " %s", ost->filter->name);
if (nb_filtergraphs > 1)
diff --git a/avconv.h b/avconv.h
index 84fabf6371..be8ef23e51 100644
--- a/avconv.h
+++ b/avconv.h
@@ -449,6 +449,7 @@ int guess_input_channel_layout(InputStream *ist);
int configure_filtergraph(FilterGraph *fg);
int configure_output_filter(FilterGraph *fg, OutputFilter *ofilter, AVFilterInOut *out);
int ist_in_filtergraph(FilterGraph *fg, InputStream *ist);
+int filtergraph_is_simple(FilterGraph *fg);
FilterGraph *init_simple_filtergraph(InputStream *ist, OutputStream *ost);
int init_complex_filtergraph(FilterGraph *fg);
diff --git a/avconv_filter.c b/avconv_filter.c
index a412f6e314..1d4aeb0770 100644
--- a/avconv_filter.c
+++ b/avconv_filter.c
@@ -691,7 +691,7 @@ static int configure_input_filter(FilterGraph *fg, InputFilter *ifilter,
int configure_filtergraph(FilterGraph *fg)
{
AVFilterInOut *inputs, *outputs, *cur;
- int ret, i, simple = !fg->graph_desc;
+ int ret, i, simple = filtergraph_is_simple(fg);
const char *graph_desc = simple ? fg->outputs[0]->ost->avfilter :
fg->graph_desc;
@@ -760,3 +760,7 @@ int ist_in_filtergraph(FilterGraph *fg, InputStream *ist)
return 0;
}
+int filtergraph_is_simple(FilterGraph *fg)
+{
+ return !fg->graph_desc;
+}