summaryrefslogtreecommitdiff
path: root/avconv_opt.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-02-21 09:53:28 +0100
committerAnton Khirnov <anton@khirnov.net>2013-03-08 14:13:46 +0100
commit41d2008b15c2e80aeaa53f3db8f9c51da13c788d (patch)
treef0c70963284294f6e631a0b96d5af81bab10bc8a /avconv_opt.c
parent1da54e908eba73eb86f5d614c51f06811c85c3ea (diff)
downloadffmpeg-41d2008b15c2e80aeaa53f3db8f9c51da13c788d.tar.gz
avconv: use a local variable for InputFile in open_input_file().
This is shorter and more readable.
Diffstat (limited to 'avconv_opt.c')
-rw-r--r--avconv_opt.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/avconv_opt.c b/avconv_opt.c
index 1d641af80a..cd3f7f65b2 100644
--- a/avconv_opt.c
+++ b/avconv_opt.c
@@ -546,6 +546,7 @@ static void dump_attachment(AVStream *st, const char *filename)
static int open_input_file(OptionsContext *o, const char *filename)
{
+ InputFile *f;
AVFormatContext *ic;
AVInputFormat *file_iformat = NULL;
int err, i, ret;
@@ -654,14 +655,16 @@ static int open_input_file(OptionsContext *o, const char *filename)
av_dump_format(ic, nb_input_files, filename, 0);
GROW_ARRAY(input_files, nb_input_files);
- if (!(input_files[nb_input_files - 1] = av_mallocz(sizeof(*input_files[0]))))
+ f = av_mallocz(sizeof(*f));
+ if (!f)
exit(1);
+ input_files[nb_input_files - 1] = f;
- input_files[nb_input_files - 1]->ctx = ic;
- input_files[nb_input_files - 1]->ist_index = nb_input_streams - ic->nb_streams;
- input_files[nb_input_files - 1]->ts_offset = o->input_ts_offset - (copy_ts ? 0 : timestamp);
- input_files[nb_input_files - 1]->nb_streams = ic->nb_streams;
- input_files[nb_input_files - 1]->rate_emu = o->rate_emu;
+ f->ctx = ic;
+ f->ist_index = nb_input_streams - ic->nb_streams;
+ f->ts_offset = o->input_ts_offset - (copy_ts ? 0 : timestamp);
+ f->nb_streams = ic->nb_streams;
+ f->rate_emu = o->rate_emu;
for (i = 0; i < o->nb_dump_attachment; i++) {
int j;