diff options
author | Anton Khirnov <anton@khirnov.net> | 2023-05-28 17:45:46 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2023-06-05 16:15:04 +0200 |
commit | 93e26a4db7784ca1372022ce7fea4a103eaf9a47 (patch) | |
tree | db053899ed32cbade7a9ac4d4c562b06f59c9bc1 /fftools/ffmpeg_enc.c | |
parent | 58a64e3d544dcedbfeebaabae19bcafce4f8b919 (diff) |
fftools/ffmpeg: handle -enc_time_base -1 during stream creation
There is no reason to postpone it until opening the encoder. Also, abort
when the input stream is unknown, rather than disregard an explicit
request from the user.
Diffstat (limited to 'fftools/ffmpeg_enc.c')
-rw-r--r-- | fftools/ffmpeg_enc.c | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/fftools/ffmpeg_enc.c b/fftools/ffmpeg_enc.c index 07928b3557..04d2c3c201 100644 --- a/fftools/ffmpeg_enc.c +++ b/fftools/ffmpeg_enc.c @@ -179,7 +179,6 @@ static void set_encoder_id(OutputFile *of, OutputStream *ost) static void init_encoder_time_base(OutputStream *ost, AVRational default_time_base) { - InputStream *ist = ost->ist; AVCodecContext *enc_ctx = ost->enc_ctx; if (ost->enc_timebase.num > 0) { @@ -187,16 +186,6 @@ static void init_encoder_time_base(OutputStream *ost, AVRational default_time_ba return; } - if (ost->enc_timebase.num < 0) { - if (ist) { - enc_ctx->time_base = ist->st->time_base; - return; - } - - av_log(ost, AV_LOG_WARNING, - "Input stream data not available, using default time base\n"); - } - enc_ctx->time_base = default_time_base; } |