aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-10-16 14:08:16 +0200
committerSven Gothel <[email protected]>2023-10-16 14:08:16 +0200
commit9e63207f07de7ab5805d166be992c7faeebef5cc (patch)
treee2b658032ff899dbea88f0483f74fe9c6c0ae045 /src
parentb7d41ff2430adad96d546228c99b4a4610a6b752 (diff)
GLMediaPlayer: Don't resetAVPTS() on resume(), allowing less AV sync disruption after pause(flush:=false)
Diffstat (limited to 'src')
-rw-r--r--src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
index 30068d51e..b6823e026 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -407,19 +407,16 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
public final State resume() {
synchronized( stateLock ) {
final State preState = state;
- switch( state ) {
- case Paused:
- if( resumeImpl() ) {
- resetAVPTS();
- if( null != audioSink ) {
- audioSink.play(); // cont. w/ new data
- }
- if( null != streamWorker ) {
- streamWorker.resume();
- }
- changeState(new GLMediaPlayer.EventMask(), State.Playing);
+ if( State.Paused == state ) {
+ if( resumeImpl() ) {
+ if( null != audioSink ) {
+ audioSink.play(); // cont. w/ new data
}
- default:
+ if( null != streamWorker ) {
+ streamWorker.resume();
+ }
+ changeState(new GLMediaPlayer.EventMask(), State.Playing);
+ }
}
if(DEBUG) { logout.println("Play: "+preState+" -> "+state+", "+toString()); }
return state;
@@ -435,7 +432,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
synchronized( stateLock ) {
final State preState = state;
if( State.Playing == state ) {
- eventMask = addStateEventMask(eventMask, GLMediaPlayer.State.Paused);
+ eventMask = addStateEventMask(eventMask, State.Paused);
setState( State.Paused );
if( null != streamWorker ) {
streamWorker.pause(true);