# HG changeset patch # User Omair Majid # Date 1222357465 14400 # Node ID 4e1873a3f88f03aa5900673165f7de8731594b8a # Parent e29a9eb84a4e921a6fa943be82874fbf4216868c 2008-09-25 Omair Majid * src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java (ClipThread.run): Dont let loopsLeft wrap around when looping continuously. diff -r e29a9eb84a4e -r 4e1873a3f88f src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java --- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Wed Sep 24 10:51:53 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Thu Sep 25 11:44:25 2008 -0400 @@ -100,7 +100,9 @@ } else { synchronized (clipLock) { currentFrame = startFrame; - loopsLeft--; + if (loopsLeft != Integer.MIN_VALUE) { + loopsLeft--; + } } } @@ -192,17 +194,20 @@ } - protected void connectLine(int bufferSize, Stream masterStream) throws LineUnavailableException{ + protected void connectLine(int bufferSize, Stream masterStream) + throws LineUnavailableException { StreamBufferAttributes bufferAttributes = new StreamBufferAttributes( bufferSize, bufferSize / 2, bufferSize / 2, bufferSize / 2, 0); - if(masterStream != null) { + if (masterStream != null) { synchronized (eventLoop.threadLock) { - stream.connectForPlayback(Stream.DEFAULT_DEVICE, bufferAttributes, masterStream.getStreamPointer()); + stream.connectForPlayback(Stream.DEFAULT_DEVICE, + bufferAttributes, masterStream.getStreamPointer()); } } else { synchronized (eventLoop.threadLock) { - stream.connectForPlayback(Stream.DEFAULT_DEVICE, bufferAttributes, null); + stream.connectForPlayback(Stream.DEFAULT_DEVICE, + bufferAttributes, null); } } }