aboutsummaryrefslogtreecommitdiffstats
path: root/src
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 /src
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.
Diffstat (limited to 'src')
-rw-r--r--src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java12
1 files changed, 6 insertions, 6 deletions
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) {