提交 308ac2f7 编写于 作者: M Marton Balint

ffmpeg: init input streams before opening encoders

Codec options of streams detected during avformat_find_stream_info are not set
therefore without this patch we initialize the encoders with decoder info
based on decoders without options.

This cause problems for probed DVB teletext streams where
avctx->subtitle_header depend on the txt_format setting.
Reviewed-by: NMichael Niedermayer <michael@niedermayer.cc>
Signed-off-by: NMarton Balint <cus@passwd.hu>
上级 6c905dd3
...@@ -3198,13 +3198,6 @@ static int transcode_init(void) ...@@ -3198,13 +3198,6 @@ static int transcode_init(void)
} }
} }
/* open each encoder */
for (i = 0; i < nb_output_streams; i++) {
ret = init_output_stream(output_streams[i], error, sizeof(error));
if (ret < 0)
goto dump_format;
}
/* init input streams */ /* init input streams */
for (i = 0; i < nb_input_streams; i++) for (i = 0; i < nb_input_streams; i++)
if ((ret = init_input_stream(i, error, sizeof(error))) < 0) { if ((ret = init_input_stream(i, error, sizeof(error))) < 0) {
...@@ -3215,6 +3208,13 @@ static int transcode_init(void) ...@@ -3215,6 +3208,13 @@ static int transcode_init(void)
goto dump_format; goto dump_format;
} }
/* open each encoder */
for (i = 0; i < nb_output_streams; i++) {
ret = init_output_stream(output_streams[i], error, sizeof(error));
if (ret < 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++) {
InputFile *ifile = input_files[i]; InputFile *ifile = input_files[i];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册