fftools/ffmpeg: move derivation of frame duration from filter framerate

From ffmpeg_enc to ffmpeg_filter, which is a more appropriate
place for it.
This commit is contained in:
Anton Khirnov
2023-07-21 18:39:08 +02:00
parent 9d4ca76c08
commit 8d12762b42
2 changed files with 6 additions and 9 deletions

View File

@@ -1817,8 +1817,12 @@ static int fg_output_step(OutputFilterPriv *ofp, int flush)
if (ost->type == AVMEDIA_TYPE_VIDEO) {
AVRational fr = av_buffersink_get_frame_rate(filter);
if (fr.num > 0 && fr.den > 0)
if (fr.num > 0 && fr.den > 0) {
fd->frame_rate_filter = fr;
if (!frame->duration)
frame->duration = av_rescale_q(1, av_inv_q(fr), frame->time_base);
}
}
ret = enc_frame(ost, frame);