aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-10-04 11:35:48 +0200
committerSven Gothel <[email protected]>2023-10-04 11:35:48 +0200
commitd0dd0c04463c6b09b1f15ce6cc3a2c50286c57bf (patch)
tree132cdf6770e892e1033acc5bbf04d3e250644fb2
parent1db4e6813bf4c70c5ba465beaee6eab8ee547d18 (diff)
Bug 1473 - ALAudioSink: AV Synchronization: Adopt to JOAL ALAudioSink changes
FFMPEGMediaPlayer: This also effectively reduces the audio buffer size from 3000ms -> 768ms, the new default for audio streams with video.
-rw-r--r--make/scripts/tests.sh4
-rw-r--r--src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java12
2 files changed, 8 insertions, 8 deletions
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index 1c5dcbbde..f58a6d5bd 100644
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -1017,7 +1017,7 @@ function testawtswt() {
#testnoawt com.jogamp.opengl.demos.graph.ui.UISceneDemo03 $*
#testnoawt com.jogamp.opengl.demos.graph.ui.UISceneDemo10 $*
#testnoawt com.jogamp.opengl.demos.graph.ui.UISceneDemo11 $*
-testnoawt com.jogamp.opengl.demos.graph.ui.UISceneDemo20 $*
+#testnoawt com.jogamp.opengl.demos.graph.ui.UISceneDemo20 $*
#testawt com.jogamp.opengl.test.junit.jogl.acore.TestDestroyGLAutoDrawableNewtAWT $*
#testnoawt com.jogamp.opengl.demos.av.MovieSimple $*
#testnoawt com.jogamp.opengl.demos.av.MovieCube $*
@@ -1035,7 +1035,7 @@ testnoawt com.jogamp.opengl.demos.graph.ui.UISceneDemo20 $*
#testnoawt com.jogamp.opengl.test.junit.graph.TestTextRendererNEWT21 $*
#testnoawt com.jogamp.opengl.demos.av.MovieCube $*
-#testnoawt com.jogamp.opengl.demos.av.MovieSimple $*
+testnoawt com.jogamp.opengl.demos.av.MovieSimple $*
#
# Basic (Demos)
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 c93cea02b..c13e3359a 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
@@ -406,7 +406,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
if(0==moviePtr) {
throw new GLException("FFMPEG native instance null");
}
- final int audioQueueLimit;
+ final int audioQueueSize;
if( null != gl && STREAM_ID_NONE != getVID() ) {
final GLContextImpl ctx = (GLContextImpl)gl.getContext();
SecurityUtil.doPrivileged(new PrivilegedAction<Object>() {
@@ -420,9 +420,9 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
natives.setGLFuncs0(moviePtr, procAddrGLTexSubImage2D, procAddrGLGetError, procAddrGLFlush, procAddrGLFinish);
return null;
} } );
- audioQueueLimit = AudioSink.DefaultQueueLimitWithVideo;
+ audioQueueSize = AudioSink.DefaultQueueSizeWithVideo;
} else {
- audioQueueLimit = AudioSink.DefaultQueueLimitAudioOnly;
+ audioQueueSize = AudioSink.DefaultQueueSize;
}
if(DEBUG) {
System.err.println("initGL: p3 aid "+getAID()+", avChosen "+avChosenAudioFormat+" on "+audioSink);
@@ -433,7 +433,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
audioSink.destroy();
}
audioSink = AudioSinkFactory.createNull();
- audioSink.init(AudioSink.DefaultFormat, 0, AudioSink.DefaultInitialQueueSize, AudioSink.DefaultQueueGrowAmount, audioQueueLimit);
+ audioSink.init(AudioSink.DefaultFormat, 0, audioQueueSize);
} else {
final int frameDuration;
if( audioSamplesPerFrameAndChannel > 0 ) {
@@ -441,12 +441,12 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
} else {
frameDuration = AudioSink.DefaultFrameDuration;
}
- final boolean audioSinkOK = audioSink.init(avChosenAudioFormat, frameDuration, AudioSink.DefaultInitialQueueSize, AudioSink.DefaultQueueGrowAmount, audioQueueLimit);
+ final boolean audioSinkOK = audioSink.init(avChosenAudioFormat, frameDuration, audioQueueSize);
if( !audioSinkOK ) {
System.err.println("AudioSink "+audioSink.getClass().getName()+" does not support "+avChosenAudioFormat+", using Null");
audioSink.destroy();
audioSink = AudioSinkFactory.createNull();
- audioSink.init(avChosenAudioFormat, 0, AudioSink.DefaultInitialQueueSize, AudioSink.DefaultQueueGrowAmount, audioQueueLimit);
+ audioSink.init(avChosenAudioFormat, 0, audioQueueSize);
}
}
if(DEBUG) {