summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2016-02-17 20:17:00 +0100
committerMarton Balint <cus@passwd.hu>2016-02-19 21:55:25 +0100
commit308ac2f7e2048e09a4f98b5c6ca4562fc7010d18 (patch)
tree9051d2d2827bc71bb19a968ea4648ad7583feb3d /ffmpeg.c
parent6c905dd3c24afd65fdb42b6f28217af85a35105a (diff)
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: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index c20f75a16d..32f7bd26b7 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -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 */
for (i = 0; i < nb_input_streams; i++)
if ((ret = init_input_stream(i, error, sizeof(error))) < 0) {
@@ -3215,6 +3208,13 @@ static int transcode_init(void)
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 */
for (i = 0; i < nb_input_files; i++) {
InputFile *ifile = input_files[i];