diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-12-03 14:34:47 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-12-05 13:27:38 +0100 |
commit | 2e7ef008e312bde7c151034628adc2da04313566 (patch) | |
tree | 501f672547c0a2d4f6b5e05e347b083db21cd958 /fftools/ffmpeg_opt.c | |
parent | 9d73967b40231b27504cb86ea177887be03bb328 (diff) |
fftools/cmdutils: Make allocate_array_elem() return ptr to new element
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'fftools/ffmpeg_opt.c')
-rw-r--r-- | fftools/ffmpeg_opt.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index bd1d451ff7..eea57a6974 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -1265,8 +1265,7 @@ static int open_input_file(OptionsContext *o, const char *filename) /* dump the file content */ av_dump_format(ic, nb_input_files, filename, 0); - ALLOC_ARRAY_ELEM(input_files, nb_input_files); - f = input_files[nb_input_files - 1]; + f = ALLOC_ARRAY_ELEM(input_files, nb_input_files); f->ctx = ic; f->ist_index = nb_input_streams - ic->nb_streams; @@ -2260,8 +2259,7 @@ static int open_output_file(OptionsContext *o, const char *filename) } } - ALLOC_ARRAY_ELEM(output_files, nb_output_files); - of = output_files[nb_output_files - 1]; + of = ALLOC_ARRAY_ELEM(output_files, nb_output_files); of->ost_index = nb_output_streams; of->recording_time = o->recording_time; @@ -3278,8 +3276,7 @@ static int opt_filter_complex_script(void *optctx, const char *opt, const char * if (!graph_desc) return AVERROR(EINVAL); - ALLOC_ARRAY_ELEM(filtergraphs, nb_filtergraphs); - fg = filtergraphs[nb_filtergraphs - 1]; + fg = ALLOC_ARRAY_ELEM(filtergraphs, nb_filtergraphs); fg->index = nb_filtergraphs - 1; fg->graph_desc = graph_desc; |