mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
revert change to avoid blocking seek, as it breaks looping.
This commit is contained in:
@@ -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();
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user