aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java22
1 files changed, 17 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 3da57a847..3ca5f9aac 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -647,9 +647,14 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
@Override
public final StreamException getStreamException() {
- final StreamException e;
+ StreamException e = null;
synchronized( stateLock ) {
- e = streamErr;
+ if( null != streamWorker ) {
+ e = streamWorker.getStreamException();
+ }
+ if( null == e ) {
+ e = streamErr;
+ }
streamErr = null;
}
return e;
@@ -1208,7 +1213,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
* {@link GLMediaPlayerImpl#updateAttributes(int, int, int, int, int, int, int, float, int, int, int, String, String) updateAttributes(..)},
* the latter decides whether StreamWorker is being used.
*/
- class StreamWorker {
+ private final class StreamWorker {
private volatile GLContext sharedGLCtx = null;
private boolean hasSharedGLCtx = false;
private GLDrawable dummyDrawable = null;
@@ -1271,6 +1276,14 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
wt.stop(waitUntilDone);
}
+ private final synchronized StreamException getStreamException() {
+ final Exception e = wt.getError(true);
+ if( null != e ) {
+ return new StreamException(e);
+ }
+ return null;
+ }
+
WorkerThread.StateCallback stateCB = (final WorkerThread self, final WorkerThread.StateCallback.State cause) -> {
switch( cause ) {
case INIT:
@@ -1364,9 +1377,8 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
wt.start( true );
}
}
- static int StreamWorkerInstanceId = 0;
private volatile StreamWorker streamWorker = null;
- private volatile StreamException streamErr = null;
+ private StreamException streamErr = null;
protected final GLMediaPlayer.EventMask addStateEventMask(final GLMediaPlayer.EventMask eventMask, final State newState) {
if( state != newState ) {