You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
fftools/ffmpeg: fix computing video frame duration from repeat_pict
This field contains the number of _field_ durations by which the standard frame duration should be extended.
This commit is contained in:
@@ -990,10 +990,10 @@ static int64_t video_duration_estimate(const InputStream *ist, const AVFrame *fr
|
|||||||
return frame->duration;
|
return frame->duration;
|
||||||
|
|
||||||
if (ist->dec_ctx->framerate.den && ist->dec_ctx->framerate.num) {
|
if (ist->dec_ctx->framerate.den && ist->dec_ctx->framerate.num) {
|
||||||
int ticks = frame->repeat_pict >= 0 ?
|
int fields = frame->repeat_pict + 2;
|
||||||
frame->repeat_pict + 1 :
|
AVRational field_rate = av_mul_q(ist->dec_ctx->framerate,
|
||||||
ist->dec_ctx->ticks_per_frame;
|
(AVRational){ 2, 1 });
|
||||||
codec_duration = av_rescale_q(ticks, av_inv_q(ist->dec_ctx->framerate),
|
codec_duration = av_rescale_q(fields, av_inv_q(field_rate),
|
||||||
ist->st->time_base);
|
ist->st->time_base);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user