From 3e17551fa1a61d1044d4e3d76c0f09293c4584d4 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 14 Mar 2023 14:22:01 +0100 Subject: GLMediaPlayerImpl: Zero textureFragmentShaderHashCode and default lookupFunction on Uninitialized state --- src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/jogl/classes/jogamp/opengl/util/av') diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java index d94fbb1a7..42dc4e70b 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java +++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java @@ -307,7 +307,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { @Override public final int getTextureFragmentShaderHashCode() { - if( !isPausedOrPlaying() ) { + if( State.Uninitialized == state ) { textureFragmentShaderHashCode = 0; return 0; } else if( 0 == textureFragmentShaderHashCode ) { @@ -876,10 +876,6 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { 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; - } - @Override public final TextureFrame getLastTexture() throws IllegalStateException { return lastFrame; @@ -1496,7 +1492,8 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { event_mask = addStateEventMask(event_mask, newState); if( 0 != event_mask ) { setState( newState ); - if( !isPausedOrPlaying() ) { + if(State.Uninitialized == state) { + textureLookupFunctionName = "texture2D"; textureFragmentShaderHashCode = 0; } attributesUpdated( event_mask ); -- cgit v1.2.3