ffmpeg was computing the frame length of avis via doubles, but was

not properly ceiling them, sometimes resulting in truncation errors.

(merge from render25 branch, commit with revision 28901 by Joe)
This commit is contained in:
Brecht Van Lommel
2010-06-22 18:18:42 +00:00
parent c28aec9ae1
commit 86de9694ff

View File

@@ -589,9 +589,9 @@ static int startffmpeg(struct anim * anim) {
anim->duration = pFormatCtx->duration * pCodecCtx->frame_rate
/ pCodecCtx->frame_rate_base / AV_TIME_BASE;
#else
anim->duration = pFormatCtx->duration
anim->duration = ceil(pFormatCtx->duration
* av_q2d(pFormatCtx->streams[videoStream]->r_frame_rate)
/ AV_TIME_BASE;
/ AV_TIME_BASE);
#endif
anim->params = 0;