From 749e09d49ecc31a5235a4af46849626b483f5936 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 9 Jan 2017 23:10:51 +0100 Subject: [PATCH] ffmpeg: don't hide last frame of video This is not quite a complete fix, since the last frame of the video won't be shown long enough for it to matter when looping the video. A more complete fix may be needed later. --- panda/src/ffmpeg/ffmpegVideoCursor.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/panda/src/ffmpeg/ffmpegVideoCursor.cxx b/panda/src/ffmpeg/ffmpegVideoCursor.cxx index c9cee499cd..8a23853811 100644 --- a/panda/src/ffmpeg/ffmpegVideoCursor.cxx +++ b/panda/src/ffmpeg/ffmpegVideoCursor.cxx @@ -327,13 +327,13 @@ set_time(double timestamp, int loop_count) { if (_eof_known) { if (loop_count == 0) { - frame = frame % _eof_frame; + frame = frame % (_eof_frame + 1); } else { - int last_frame = _eof_frame * loop_count; + int last_frame = (_eof_frame + 1) * loop_count; if (frame < last_frame) { - frame = frame % _eof_frame; + frame = frame % (_eof_frame + 1); } else { - frame = _eof_frame - 1; + frame = _eof_frame; } } }