aboutsummaryrefslogtreecommitdiffstats
path: root/avconv.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-01-18 20:00:23 +0100
committerAnton Khirnov <anton@khirnov.net>2016-02-23 17:01:58 +0100
commit5b9cdf8cba114c41239bf0f9f5e0ccb6977d1c8d (patch)
treea112b583bc4ad985d7df070efd8cdfd808946289 /avconv.c
parent9200514ad8717c63f82101dc394f4378854325bf (diff)
downloadffmpeg-5b9cdf8cba114c41239bf0f9f5e0ccb6977d1c8d.tar.gz
avconv: switch opening decoders and encoders
Open decoders first, next encoders. This makes sure that that subtitle_header is always set properly, without relying on avformat_find_stream_info() setting it.
Diffstat (limited to 'avconv.c')
-rw-r--r--avconv.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/avconv.c b/avconv.c
index a84a345734..a058b1de88 100644
--- a/avconv.c
+++ b/avconv.c
@@ -1943,6 +1943,11 @@ static int transcode_init(void)
}
}
+ /* init input streams */
+ for (i = 0; i < nb_input_streams; i++)
+ if ((ret = init_input_stream(i, error, sizeof(error))) < 0)
+ goto dump_format;
+
/* open each encoder */
for (i = 0; i < nb_output_streams; i++) {
ret = init_output_stream(output_streams[i], error, sizeof(error));
@@ -1950,10 +1955,6 @@ static int transcode_init(void)
goto dump_format;
}
- /* init input streams */
- for (i = 0; i < nb_input_streams; i++)
- if ((ret = init_input_stream(i, error, sizeof(error))) < 0)
- goto dump_format;
/* discard unused programs */
for (i = 0; i < nb_input_files; i++) {