diff options
author | Sven Gothel <[email protected]> | 2023-03-13 06:47:05 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-03-13 06:47:05 +0100 |
commit | 357964eba18e73eb69e0ad68c85fca0a0e1ea192 (patch) | |
tree | d9bd3c925efbe79f622653a3d492a0c9612b2403 /src/jogl/classes/jogamp/opengl | |
parent | 6b39e7be037f13a72d7ba1ead24f01697823d779 (diff) |
GLMediaPlayerImpl: isTextureAvailable() is always true after lastFrame init; Use private isPausedOrPlaying() to determine shaderCodeHash
Diffstat (limited to 'src/jogl/classes/jogamp/opengl')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java index d29464552..a9e4b5bc3 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java +++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java @@ -293,7 +293,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { @Override public final int getTextureFragmentShaderHashCode() { - if( !isTextureAvailable() ) { + if( !isPausedOrPlaying() ) { textureFragmentShaderHashCode = 0; return 0; } else if( 0 == textureFragmentShaderHashCode ) { @@ -858,6 +858,10 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { @Override public final boolean isTextureAvailable() { + return null != lastFrame; // Note: lastFrame is test-texture if using initGL() pre stream ready + } + + private final boolean isPausedOrPlaying() { return State.Paused == state || State.Playing == state; } @@ -1477,7 +1481,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { event_mask = addStateEventMask(event_mask, newState); if( 0 != event_mask ) { setState( newState ); - if( !isTextureAvailable() ) { + if( !isPausedOrPlaying() ) { textureFragmentShaderHashCode = 0; } attributesUpdated( event_mask ); |