diff options
-rw-r--r-- | src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java | 10 | ||||
-rw-r--r-- | src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java index 8859d537e..b8dbcdb24 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java +++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java @@ -583,7 +583,15 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { */ protected boolean setAudioVolumeImpl(final float v) { if( null != audioSink ) { - return audioSink.setVolume(v); + final boolean res = audioSink.setVolume(v); + if( State.Playing == state ) { + if( FloatUtil.isZero(v) ) { + audioSink.flush(); // implies stop! + } else { + audioSink.play(); // cont. w/ new data + } + } + return res; } // still true, even if audioSink rejects command .. return true; diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java index 7b86b012d..91cf5f29d 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java +++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java @@ -900,7 +900,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl { final void pushSound(final ByteBuffer sampleData, final int data_size, final int audio_pts) { setFirstAudioPTS2SCR( audio_pts ); - if( 1.0f == getPlaySpeed() || audioSinkPlaySpeedSet ) { + if( !isAudioMuted() && ( 1.0f == getPlaySpeed() || audioSinkPlaySpeedSet ) ) { audioSink.enqueueData( audio_pts, sampleData, data_size); } } |