Commit 5b9cdf8c authored by Anton Khirnov's avatar Anton Khirnov

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.
parent 9200514a
...@@ -1943,6 +1943,11 @@ static int transcode_init(void) ...@@ -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 */ /* open each encoder */
for (i = 0; i < nb_output_streams; i++) { for (i = 0; i < nb_output_streams; i++) {
ret = init_output_stream(output_streams[i], error, sizeof(error)); ret = init_output_stream(output_streams[i], error, sizeof(error));
...@@ -1950,10 +1955,6 @@ static int transcode_init(void) ...@@ -1950,10 +1955,6 @@ static int transcode_init(void)
goto dump_format; 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 */ /* discard unused programs */
for (i = 0; i < nb_input_files; i++) { for (i = 0; i < nb_input_files; i++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment