diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-10-12 17:17:43 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-10-12 17:17:43 +0300 |
commit | a54242503e3fd50dcd4d3af8b39e1d2a6e138e45 (patch) | |
tree | 1abb398d4d91cb71ce3079f6bf121f6a512459aa /source/blender/imbuf | |
parent | 22cdf441018f6ff358fed68aae33cf6dada5119e (diff) |
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..
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r-- | source/blender/imbuf/intern/anim_movie.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c index d378ca9a78c..a40b257b75b 100644 --- a/source/blender/imbuf/intern/anim_movie.c +++ b/source/blender/imbuf/intern/anim_movie.c @@ -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; |