avconv: use a local variable for InputFile in open_input_file().
This is shorter and more readable.
This commit is contained in:
parent
1da54e908e
commit
41d2008b15
15
avconv_opt.c
15
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)
|
static int open_input_file(OptionsContext *o, const char *filename)
|
||||||
{
|
{
|
||||||
|
InputFile *f;
|
||||||
AVFormatContext *ic;
|
AVFormatContext *ic;
|
||||||
AVInputFormat *file_iformat = NULL;
|
AVInputFormat *file_iformat = NULL;
|
||||||
int err, i, ret;
|
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);
|
av_dump_format(ic, nb_input_files, filename, 0);
|
||||||
|
|
||||||
GROW_ARRAY(input_files, nb_input_files);
|
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);
|
exit(1);
|
||||||
|
input_files[nb_input_files - 1] = f;
|
||||||
|
|
||||||
input_files[nb_input_files - 1]->ctx = ic;
|
f->ctx = ic;
|
||||||
input_files[nb_input_files - 1]->ist_index = nb_input_streams - ic->nb_streams;
|
f->ist_index = nb_input_streams - ic->nb_streams;
|
||||||
input_files[nb_input_files - 1]->ts_offset = o->input_ts_offset - (copy_ts ? 0 : timestamp);
|
f->ts_offset = o->input_ts_offset - (copy_ts ? 0 : timestamp);
|
||||||
input_files[nb_input_files - 1]->nb_streams = ic->nb_streams;
|
f->nb_streams = ic->nb_streams;
|
||||||
input_files[nb_input_files - 1]->rate_emu = o->rate_emu;
|
f->rate_emu = o->rate_emu;
|
||||||
|
|
||||||
for (i = 0; i < o->nb_dump_attachment; i++) {
|
for (i = 0; i < o->nb_dump_attachment; i++) {
|
||||||
int j;
|
int j;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user