aboutsummaryrefslogtreecommitdiffstats
path: root/avconv_filter.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-06-07 21:52:07 +0200
committerAnton Khirnov <anton@khirnov.net>2012-12-18 20:11:06 +0100
commit10bca66101b79954512cd9d8ee20c3bc4513adf3 (patch)
treefd570266d7e33d169215e376064784a3bb733035 /avconv_filter.c
parent9e696d2e5ffaa763c564682ec18c3b51b3e5fccc (diff)
downloadffmpeg-10bca66101b79954512cd9d8ee20c3bc4513adf3.tar.gz
cmdutils: add a macro to simplify grow_array() calls.
Diffstat (limited to 'avconv_filter.c')
-rw-r--r--avconv_filter.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/avconv_filter.c b/avconv_filter.c
index e9412abc96..50e1e7315a 100644
--- a/avconv_filter.c
+++ b/avconv_filter.c
@@ -77,8 +77,7 @@ FilterGraph *init_simple_filtergraph(InputStream *ist, OutputStream *ost)
exit(1);
fg->index = nb_filtergraphs;
- fg->outputs = grow_array(fg->outputs, sizeof(*fg->outputs), &fg->nb_outputs,
- fg->nb_outputs + 1);
+ GROW_ARRAY(fg->outputs, fg->nb_outputs);
if (!(fg->outputs[0] = av_mallocz(sizeof(*fg->outputs[0]))))
exit(1);
fg->outputs[0]->ost = ost;
@@ -86,19 +85,16 @@ FilterGraph *init_simple_filtergraph(InputStream *ist, OutputStream *ost)
ost->filter = fg->outputs[0];
- fg->inputs = grow_array(fg->inputs, sizeof(*fg->inputs), &fg->nb_inputs,
- fg->nb_inputs + 1);
+ GROW_ARRAY(fg->inputs, fg->nb_inputs);
if (!(fg->inputs[0] = av_mallocz(sizeof(*fg->inputs[0]))))
exit(1);
fg->inputs[0]->ist = ist;
fg->inputs[0]->graph = fg;
- ist->filters = grow_array(ist->filters, sizeof(*ist->filters),
- &ist->nb_filters, ist->nb_filters + 1);
+ GROW_ARRAY(ist->filters, ist->nb_filters);
ist->filters[ist->nb_filters - 1] = fg->inputs[0];
- filtergraphs = grow_array(filtergraphs, sizeof(*filtergraphs),
- &nb_filtergraphs, nb_filtergraphs + 1);
+ GROW_ARRAY(filtergraphs, nb_filtergraphs);
filtergraphs[nb_filtergraphs - 1] = fg;
return fg;
@@ -164,15 +160,13 @@ static void init_input_filter(FilterGraph *fg, AVFilterInOut *in)
ist->decoding_needed = 1;
ist->st->discard = AVDISCARD_NONE;
- fg->inputs = grow_array(fg->inputs, sizeof(*fg->inputs),
- &fg->nb_inputs, fg->nb_inputs + 1);
+ GROW_ARRAY(fg->inputs, fg->nb_inputs);
if (!(fg->inputs[fg->nb_inputs - 1] = av_mallocz(sizeof(*fg->inputs[0]))))
exit(1);
fg->inputs[fg->nb_inputs - 1]->ist = ist;
fg->inputs[fg->nb_inputs - 1]->graph = fg;
- ist->filters = grow_array(ist->filters, sizeof(*ist->filters),
- &ist->nb_filters, ist->nb_filters + 1);
+ GROW_ARRAY(ist->filters, ist->nb_filters);
ist->filters[ist->nb_filters - 1] = fg->inputs[fg->nb_inputs - 1];
}
@@ -541,8 +535,7 @@ int configure_filtergraph(FilterGraph *fg)
} else {
/* wait until output mappings are processed */
for (cur = outputs; cur;) {
- fg->outputs = grow_array(fg->outputs, sizeof(*fg->outputs),
- &fg->nb_outputs, fg->nb_outputs + 1);
+ GROW_ARRAY(fg->outputs, fg->nb_outputs);
if (!(fg->outputs[fg->nb_outputs - 1] = av_mallocz(sizeof(*fg->outputs[0]))))
exit(1);
fg->outputs[fg->nb_outputs - 1]->graph = fg;