diff options
author | Anton Khirnov <anton@khirnov.net> | 2023-04-11 13:47:12 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2023-04-17 12:01:40 +0200 |
commit | de38e17583bf5b542188810c1079abcf0c9ff8da (patch) | |
tree | db8c33fefbac2e1237300c77e2ac95557b3851dc /fftools/ffmpeg.c | |
parent | 2058402e001268e8bc68b33a8979429a73ed1b74 (diff) | |
download | ffmpeg-de38e17583bf5b542188810c1079abcf0c9ff8da.tar.gz |
fftools/ffmpeg: initialize no-filter streams earlier
There is no reason to postpone it until transcode_init() anymore, it can
be done right at the end of of_open().
Diffstat (limited to 'fftools/ffmpeg.c')
-rw-r--r-- | fftools/ffmpeg.c | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index c2dafeb46e..14861fec4e 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -1853,23 +1853,6 @@ static int process_input_packet(InputStream *ist, const AVPacket *pkt, int no_eo return !eof_reached; } -static int init_output_stream_nofilter(OutputStream *ost) -{ - int ret = 0; - - if (ost->enc_ctx) { - ret = enc_open(ost, NULL); - if (ret < 0) - return ret; - } else { - ret = of_stream_init(output_files[ost->file_index], ost); - if (ret < 0) - return ret; - } - - return ret; -} - static int transcode_init(void) { int ret = 0; @@ -1882,22 +1865,6 @@ static int transcode_init(void) ifile->streams[j]->start = av_gettime_relative(); } - /* - * initialize stream copy and subtitle/data streams. - * Encoded AVFrame based streams will get initialized when the first AVFrame - * is received in do_video_out - */ - for (OutputStream *ost = ost_iter(NULL); ost; ost = ost_iter(ost)) { - if (ost->enc_ctx && - (ost->st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO || - ost->st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO)) - continue; - - ret = init_output_stream_nofilter(ost); - if (ret < 0) - goto dump_format; - } - /* discard unused programs */ for (int i = 0; i < nb_input_files; i++) { InputFile *ifile = input_files[i]; @@ -1914,7 +1881,6 @@ static int transcode_init(void) } } - dump_format: /* dump the stream mapping */ av_log(NULL, AV_LOG_INFO, "Stream mapping:\n"); for (InputStream *ist = ist_iter(NULL); ist; ist = ist_iter(ist)) { |