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.
This commit is contained in:
@@ -1149,6 +1149,15 @@ static OutputStream *ost_add(Muxer *mux, const OptionsContext *o,
|
||||
av_log(ost, AV_LOG_FATAL, "Invalid time base: %s\n", enc_time_base);
|
||||
exit_program(1);
|
||||
}
|
||||
if (q.num < 0) {
|
||||
if (!ost->ist) {
|
||||
av_log(ost, AV_LOG_FATAL,
|
||||
"Cannot use input stream timebase for encoding - "
|
||||
"no input stream available\n");
|
||||
exit_program(1);
|
||||
}
|
||||
q = ost->ist->st->time_base;
|
||||
}
|
||||
ost->enc_timebase = q;
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user