diff options
author | Sven Göthel <[email protected]> | 2024-02-07 02:25:58 +0100 |
---|---|---|
committer | Sven Göthel <[email protected]> | 2024-02-07 02:25:58 +0100 |
commit | 2c84a3f7bf97ecfe445cd33a14ac7f968deb3e5e (patch) | |
tree | 3c2f6f80adfbdaadb98c52723b41057a2c0d646f /src | |
parent | 1d54666a16863d69a03345ab7ef4aaa3332a79ac (diff) |
GLMediaPlayerImpl: Fix playing one frame after seek() @ getNextTexture(), requires pause state (normal at play-state)
Diffstat (limited to 'src')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java index 776a54406..ff683281c 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java +++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java @@ -108,7 +108,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { private volatile State state; private final Object stateLock = new Object(); - private final AtomicBoolean oneVideoFrameOnce = new AtomicBoolean(false); + private final AtomicBoolean oneVideoFrameAtPause = new AtomicBoolean(false); private int textureCount; private int textureTarget; @@ -587,7 +587,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { pts1 = 0; } } - oneVideoFrameOnce.set(true); + oneVideoFrameAtPause.set(true); if(DEBUG) { logout.println("Seek("+msec+"): "+preState+" -> "+state+", "+toString()); } return pts1; } @@ -1189,7 +1189,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { @Override public final TextureFrame getNextTexture(final GL gl) throws IllegalStateException { synchronized( stateLock ) { - final boolean oneVideoFrame = oneVideoFrameOnce.compareAndSet(true, false); + final boolean oneVideoFrame = State.Paused == state && oneVideoFrameAtPause.compareAndSet(true, false); if( oneVideoFrame || State.Playing == state ) { boolean dropFrame = false; try { @@ -1283,7 +1283,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { } } if( !hasVideoFrame && oneVideoFrame ) { - oneVideoFrameOnce.set(true); + oneVideoFrameAtPause.set(true); } if( hasVideoFrame && video_pts.isValid() ) { |