summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-03-04 04:28:59 +0100
committerSven Gothel <[email protected]>2023-03-04 04:28:59 +0100
commit24b238fb9b7503f30f9309eec289386a4003f3da (patch)
tree5f2d760ff0ae014b5d9dfbc8a61d124ae2c48a91 /src/jogl/classes/jogamp/opengl
parentbc05d39965ec513a468b841dd1e696c2e371fdd2 (diff)
GLMediaPlayerImpl: destroyImpl(..) @ initGL(..) exception: Don't wait for streamWorker stop result (-> deadlock)
Diffstat (limited to 'src/jogl/classes/jogamp/opengl')
-rw-r--r--src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
index 5d686fc21..2a1e149d0 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -389,12 +389,12 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
@Override
public final State destroy(final GL gl) {
- return destroyImpl(gl, 0);
+ return destroyImpl(gl, 0, true);
}
- private final State destroyImpl(final GL gl, final int event_mask) {
+ private final State destroyImpl(final GL gl, final int event_mask, final boolean wait) {
synchronized( stateLock ) {
if( null != streamWorker ) {
- streamWorker.doStop();
+ streamWorker.doStopImpl(wait);
streamWorker = null;
}
destroyImpl(gl);
@@ -660,7 +660,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
}
changeState(0, State.Paused);
} catch (final Throwable t) {
- destroyImpl(gl, GLMediaEventListener.EVENT_CHANGE_ERR); // -> GLMediaPlayer.State.Uninitialized
+ destroyImpl(gl, GLMediaEventListener.EVENT_CHANGE_ERR, false /* wait */); // -> GLMediaPlayer.State.Uninitialized
throw new GLException("Error initializing GL resources", t);
}
}
@@ -1183,6 +1183,9 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
}
}
public final synchronized void doStop() {
+ doStopImpl(true);
+ }
+ private final synchronized void doStopImpl(final boolean wait) {
if( isRunning ) {
shallStop = true;
if( java.lang.Thread.currentThread() != this ) {
@@ -1191,7 +1194,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
}
try {
this.notifyAll(); // wake-up pause-block (opt)
- while( isRunning ) {
+ while( isRunning && wait ) {
this.wait(); // wait until stopped
}
} catch (final InterruptedException e) {