From 357964eba18e73eb69e0ad68c85fca0a0e1ea192 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 13 Mar 2023 06:47:05 +0100 Subject: GLMediaPlayerImpl: isTextureAvailable() is always true after lastFrame init; Use private isPausedOrPlaying() to determine shaderCodeHash --- src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 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 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 ); -- cgit v1.2.3