From a2801bdd60a42bdc0cbe368667eee0c7ae69c387 Mon Sep 17 00:00:00 2001 From: codeanticode Date: Wed, 15 Aug 2012 04:54:24 +0000 Subject: [PATCH] jump to multiple of framerate --- java/libraries/video/src/processing/video/Movie.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/java/libraries/video/src/processing/video/Movie.java b/java/libraries/video/src/processing/video/Movie.java index 8f15cdc6e..e54045517 100644 --- a/java/libraries/video/src/processing/video/Movie.java +++ b/java/libraries/video/src/processing/video/Movie.java @@ -292,6 +292,12 @@ public class Movie extends PImage implements PConstants { initSink(); } + // Round the time to a multiple of the source framerate, in + // order to eliminate stutter. Suggested by Daniel Shiffman + float fps = getSourceFrameRate(); + int frame = (int)(where * fps); + where = frame / fps; + boolean res; long pos = Video.secToNanoLong(where);