Browse Source

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.

rdb 9 years ago
parent
commit
749e09d49e
1 changed files with 4 additions and 4 deletions
  1. 4 4
      panda/src/ffmpeg/ffmpegVideoCursor.cxx

+ 4 - 4
panda/src/ffmpeg/ffmpegVideoCursor.cxx

@@ -327,13 +327,13 @@ set_time(double timestamp, int loop_count) {
 
 
   if (_eof_known) {
   if (_eof_known) {
     if (loop_count == 0) {
     if (loop_count == 0) {
-      frame = frame % _eof_frame;
+      frame = frame % (_eof_frame + 1);
     } else {
     } else {
-      int last_frame = _eof_frame * loop_count;
+      int last_frame = (_eof_frame + 1) * loop_count;
       if (frame < last_frame) {
       if (frame < last_frame) {
-        frame = frame % _eof_frame;
+        frame = frame % (_eof_frame + 1);
       } else {
       } else {
-        frame = _eof_frame - 1;
+        frame = _eof_frame;
       }
       }
     }
     }
   }
   }