summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-12-11 07:41:31 +0100
committerSven Gothel <[email protected]>2013-12-11 07:41:31 +0100
commita1be0f69bacb315e40a017b8997ef1c610da576e (patch)
treea388af7b5049ceb272db0d1c9d0450d6fa35afed /src
parentc6ab1bc932d9a0b3897b24d289e4d561bf8bb65c (diff)
Bug 918: GLMediaPlayer: Fix Deadlock if EOS happens after pause/resume (seek) - Tested w/ seeking 'Audio Only' and Matroska
Test stream was default of MovieSimple: http://video.webmfiles.org/big-buck-bunny_trailer.webm while disabling video (-vid -2)
Diffstat (limited to 'src')
-rw-r--r--src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java28
1 files changed, 18 insertions, 10 deletions
diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
index 04a8beb48..ae3f901a1 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -385,7 +385,9 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
if( null != audioSink && State.Playing == _state ) {
audioSink.play(); // cont. w/ new data
}
- System.err.println("SEEK XXX: "+getPerfString());
+ if(DEBUG) {
+ System.err.println("Seek("+msec+"): "+getPerfString());
+ }
if( null != streamWorker ) {
streamWorker.doResume();
}
@@ -1073,7 +1075,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
shallPause = false;
if( Thread.currentThread() != this ) {
while( !isActive ) {
- this.notify(); // wake-up pause-block
+ this.notifyAll(); // wake-up pause-block
try {
this.wait(); // wait until resumed
} catch (InterruptedException e) {
@@ -1091,7 +1093,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
this.interrupt();
}
while( isRunning ) {
- this.notify(); // wake-up pause-block (opt)
+ this.notifyAll(); // wake-up pause-block (opt)
try {
this.wait(); // wait until stopped
} catch (InterruptedException e) {
@@ -1133,7 +1135,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
}
while( shallPause && !shallStop ) {
isActive = false;
- this.notify(); // wake-up doPause()
+ this.notifyAll(); // wake-up doPause()
try {
this.wait(); // wait until resumed
} catch (InterruptedException e) {
@@ -1147,7 +1149,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
preNextTextureImpl(sharedGLCtx.getGL());
}
isActive = true;
- this.notify(); // wake-up doResume()
+ this.notifyAll(); // wake-up doResume()
}
}
if( !sharedGLCtxCurrent && null != sharedGLCtx ) {
@@ -1191,8 +1193,11 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
// audio only
if( TimeFrameI.END_OF_STREAM_PTS == vPTS ) {
// state transition incl. notification
- shallPause = true;
- isActive = false;
+ synchronized ( this ) {
+ shallPause = true;
+ isActive = false;
+ this.notifyAll(); // wake-up potential do*()
+ }
pauseImpl(true, GLMediaEventListener.EVENT_CHANGE_EOS);
}
}
@@ -1215,8 +1220,11 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
t.printStackTrace();
}
// state transition incl. notification
- shallPause = true;
- isActive = false;
+ synchronized ( this ) {
+ shallPause = true;
+ isActive = false;
+ this.notifyAll(); // wake-up potential do*()
+ }
pauseImpl(true, GLMediaEventListener.EVENT_CHANGE_ERR);
}
}
@@ -1229,7 +1237,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
destroySharedGL();
isRunning = false;
isActive = false;
- this.notify(); // wake-up doStop()
+ this.notifyAll(); // wake-up doStop()
}
}
}