aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-10-16 03:03:45 +0200
committerSven Gothel <[email protected]>2023-10-16 03:03:45 +0200
commit2a91bec43a7a58efc22dd36e919308ecc50d9b4a (patch)
tree4ad0b1a3ec4e93782420651a021df2daf3890bd4 /src
parent52725b4c6525487f93407f529dc0a758b387a4fc (diff)
PTS: get(currentMillis): Employ rounding in integer conversion
Diffstat (limited to 'src')
-rw-r--r--src/java/com/jogamp/common/av/PTS.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/java/com/jogamp/common/av/PTS.java b/src/java/com/jogamp/common/av/PTS.java
index 891a323..f6edf6e 100644
--- a/src/java/com/jogamp/common/av/PTS.java
+++ b/src/java/com/jogamp/common/av/PTS.java
@@ -111,13 +111,13 @@ public final class PTS {
/**
* Returns the {@link #getLast() last updated PTS}, interpolated by {@link #getSCR() System Clock Reference (SCR)} delta to given {@code currentMillis} and playback {@link #getSpeed() speed}.
* <pre>
- * last_pts + ( currentMillis - SCR ) * speed
+ * last_pts + (int) ( ( currentMillis - SCR ) * speed + 0.5f )
* </pre>
* @param currentMillis current system clock in milliseconds, i.e. {@link Clock#currentMillis()}.
* @see #set(long, int)
*/
public int get(final long currentMillis) {
- return pts + (int) ( ( currentMillis - scr ) * speed.get() );
+ return pts + (int) ( ( currentMillis - scr ) * speed.get() + 0.5f );
}
/** Returns {@link #getLast()} - rhs.{@link #getLast()}. */