aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg_filter.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-12-19 22:03:54 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-12-19 22:04:03 +0100
commit330983b728cceaf8f18557f23e333375a76f1a73 (patch)
treececbaa72dd42c52833e8a1b57fdc018eb357cebd /ffmpeg_filter.c
parentf61498e1dfbac9f07f826340c00f9caf7235766c (diff)
parent10bca66101b79954512cd9d8ee20c3bc4513adf3 (diff)
downloadffmpeg-330983b728cceaf8f18557f23e333375a76f1a73.tar.gz
Merge commit '10bca66101b79954512cd9d8ee20c3bc4513adf3'
* commit '10bca66101b79954512cd9d8ee20c3bc4513adf3': cmdutils: add a macro to simplify grow_array() calls. Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg_filter.c')
-rw-r--r--ffmpeg_filter.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/ffmpeg_filter.c b/ffmpeg_filter.c
index ebf98c6c58..ebd44e30ea 100644
--- a/ffmpeg_filter.c
+++ b/ffmpeg_filter.c
@@ -179,8 +179,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;
@@ -188,19 +187,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;
@@ -269,15 +265,13 @@ static void init_input_filter(FilterGraph *fg, AVFilterInOut *in)
ist->decoding_needed++;
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];
}
@@ -772,8 +766,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;