aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
diff options
context:
space:
mode:
authorSven Göthel <[email protected]>2024-02-04 13:31:00 +0100
committerSven Göthel <[email protected]>2024-02-04 13:31:00 +0100
commitd35a9d954fbe638546f95f0122b8c083ee4bd809 (patch)
treea85feecb209fe3d407632e8097e36b8654d053db /src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
parente4ddb70fcdf36beaccc991c8642f9343eb048057 (diff)
GLMediaPlayer.Chapter: Add duration()
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
index 191b96e56..6eab3fd6f 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
@@ -285,6 +285,8 @@ public interface GLMediaPlayer extends TextureSequence {
public Chapter(final int i, final int s, final int e, final String t) {
id = i; start = s; end = e; title = t;
}
+ /** Returns chapter duration, i.e. {@code end - start + 1}. */
+ public int duration() { return end - start + 1; }
@Override
public String toString() {
return String.format("%02d: [%s .. %s] %s", id, PTS.toTimeStr(start), PTS.toTimeStr(end), title);