revert change to avoid blocking seek, as it breaks looping.

This commit is contained in:
codeanticode
2014-05-18 22:46:50 -04:00
parent 22c96d2eea
commit 8f4e16638c
@@ -297,6 +297,34 @@ public class Movie extends PImage implements PConstants {
* @brief Jumps to a specific location
*/
public void jump(float where) {
if (seeking) return;
if (!sinkReady) {
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);
res = playbin.seek(rate, Format.TIME, SeekFlags.FLUSH,
SeekType.SET, pos, SeekType.NONE, -1);
if (!res) {
PGraphics.showWarning("Seek operation failed.");
}
// getState() will wait until any async state change
// (like seek in this case) has completed
seeking = true;
playbin.getState();
seeking = false;
/*
if (seeking) return; // don't seek again until the current seek operation is done.
if (!sinkReady) {
@@ -329,6 +357,7 @@ public class Movie extends PImage implements PConstants {
}
};
seeker.start();
*/
}