FFmpeg: Fix off by one error in number of detected frames in matroska container
Seems to be rounding error. Hopefully new code handles the error fixed back in SVN revision 28901 and still have proper frame number for Hjalti. What could possibly go wrong here..
This commit is contained in:
parent
22cdf44101
commit
a54242503e
|
@ -522,9 +522,9 @@ static int startffmpeg(struct anim *anim)
|
|||
anim->duration = pFormatCtx->streams[videoStream]->nb_frames;
|
||||
}
|
||||
else {
|
||||
anim->duration = ceil(pFormatCtx->duration *
|
||||
av_q2d(frame_rate) /
|
||||
AV_TIME_BASE);
|
||||
anim->duration = (int)(pFormatCtx->duration *
|
||||
av_q2d(frame_rate) /
|
||||
AV_TIME_BASE + 0.5f);
|
||||
}
|
||||
|
||||
frs_num = frame_rate.num;
|
||||
|
|
Loading…
Reference in New Issue