From f93b6c570b94beab1656f0024bdc06a22b2431d6 Mon Sep 17 00:00:00 2001 From: Sven Göthel Date: Wed, 31 Jan 2024 11:36:38 +0100 Subject: Utilize PTS.getCurrent() where applicable --- src/demos/com/jogamp/opengl/demos/av/MovieCube.java | 4 ++-- src/demos/com/jogamp/opengl/demos/av/MovieSBSStereo.java | 6 +++--- src/demos/com/jogamp/opengl/demos/av/MovieSimple.java | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/demos/com/jogamp') diff --git a/src/demos/com/jogamp/opengl/demos/av/MovieCube.java b/src/demos/com/jogamp/opengl/demos/av/MovieCube.java index 4add48503..a7b02d5c1 100644 --- a/src/demos/com/jogamp/opengl/demos/av/MovieCube.java +++ b/src/demos/com/jogamp/opengl/demos/av/MovieCube.java @@ -210,7 +210,7 @@ public class MovieCube implements GLEventListener { final GLAnimatorControl anim = drawable.getAnimator(); final float lfps = null != anim ? anim.getLastFPS() : 0f; final float tfps = null != anim ? anim.getTotalFPS() : 0f; - final float pts = mPlayer.getPTS().get(Clock.currentMillis()) / 1000f; + final float pts = mPlayer.getPTS().getCurrent() / 1000f; // Note: MODELVIEW is from [ -1 .. 1 ] @@ -291,7 +291,7 @@ public class MovieCube implements GLEventListener { return; } System.err.println("MC "+e); - final int pts0 = mPlayer.getPTS().get(Clock.currentMillis()); + final int pts0 = mPlayer.getPTS().getCurrent(); int pts1 = 0; switch(e.getKeySymbol()) { diff --git a/src/demos/com/jogamp/opengl/demos/av/MovieSBSStereo.java b/src/demos/com/jogamp/opengl/demos/av/MovieSBSStereo.java index 8b0c0daac..576b271f2 100644 --- a/src/demos/com/jogamp/opengl/demos/av/MovieSBSStereo.java +++ b/src/demos/com/jogamp/opengl/demos/av/MovieSBSStereo.java @@ -171,7 +171,7 @@ public class MovieSBSStereo implements StereoGLEventListener { final GLAnimatorControl anim = drawable.getAnimator(); final float lfps = null != anim ? anim.getLastFPS() : 0f; final float tfps = null != anim ? anim.getTotalFPS() : 0f; - final float pts = mPlayer.getPTS().get(Clock.currentMillis()) / 1000f; + final float pts = mPlayer.getPTS().getCurrent() / 1000f; // Note: MODELVIEW is from [ 0 .. height ] @@ -238,7 +238,7 @@ public class MovieSBSStereo implements StereoGLEventListener { if(y>surfHeight/2) { final float dp = (float)(x-prevMouseX)/(float)surfWidth; - final int pts0 = mPlayer.getPTS().get(Clock.currentMillis()); + final int pts0 = mPlayer.getPTS().getCurrent(); mPlayer.seek(pts0 + (int) (mPlayer.getDuration() * dp)); } else { mPlayer.resume(); @@ -264,7 +264,7 @@ public class MovieSBSStereo implements StereoGLEventListener { return; } System.err.println("MC "+e); - final int pts0 = mPlayer.getPTS().get(Clock.currentMillis()); + final int pts0 = mPlayer.getPTS().getCurrent(); int pts1 = 0; switch(e.getKeySymbol()) { case KeyEvent.VK_O: displayOSD = !displayOSD; break; diff --git a/src/demos/com/jogamp/opengl/demos/av/MovieSimple.java b/src/demos/com/jogamp/opengl/demos/av/MovieSimple.java index 42714b65c..b553210f5 100644 --- a/src/demos/com/jogamp/opengl/demos/av/MovieSimple.java +++ b/src/demos/com/jogamp/opengl/demos/av/MovieSimple.java @@ -259,7 +259,7 @@ public class MovieSimple implements GLEventListener { if(y>surfHeight/2) { final float dp = (float)(x-prevMouseX)/(float)surfWidth; - final int pts0 = mPlayer.getPTS().get(Clock.currentMillis()); + final int pts0 = mPlayer.getPTS().getCurrent(); mPlayer.seek(pts0 + (int) (mPlayer.getDuration() * dp)); } else { mPlayer.resume(); @@ -291,7 +291,7 @@ public class MovieSimple implements GLEventListener { return; } System.err.println("MC "+e); - final int pts0 = mPlayer.getPTS().get(Clock.currentMillis()); + final int pts0 = mPlayer.getPTS().getCurrent(); int pts1 = 0; switch(e.getKeySymbol()) { case KeyEvent.VK_V: { -- cgit v1.2.3