diff options
Diffstat (limited to 'src/jogl/classes/jogamp/opengl')
-rw-r--r-- | src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java b/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java index c8004d6b3..690948c5a 100644 --- a/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java +++ b/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java @@ -3,6 +3,8 @@ package jogamp.opengl.openal.av; import java.nio.Buffer; import java.nio.ByteBuffer; +import java.lang.InterruptedException; + import jogamp.opengl.util.av.AudioSink; import com.jogamp.common.nio.Buffers; @@ -135,6 +137,12 @@ public class ALAudioSink implements AudioSink { int[] val=new int[1]; do { al.alGetSourcei(source[0], AL.AL_BUFFERS_PROCESSED, val, 0); + if(val[0] <= 0){ + try { + Thread.sleep(1); + } catch (InterruptedException e){ + } + } } while (val[0] <= 0); // fill and requeue the empty buffer |