Mercurial > hg > pulseaudio
changeset 158:a6a5ca46e90e
2008-09-30 Omair Majid <omajid@redhat.com>
* src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java
(open): Initialize varaibles to sane values on open to survive reopening.
author | Omair Majid <omajid@redhat.com> |
---|---|
date | Tue, 30 Sep 2008 14:43:55 -0400 |
parents | 55bb87d31a6f |
children | a9057b218aa0 |
files | src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java |
diffstat | 1 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Tue Sep 30 12:17:33 2008 -0400 +++ b/src/java/org/classpath/icedtea/pulseaudio/PulseAudioClip.java Tue Sep 30 14:43:55 2008 -0400 @@ -70,7 +70,7 @@ public static final String DEFAULT_CLIP_NAME = "Clip"; private Object clipLock = new Object(); - private int loopsLeft; + private int loopsLeft = 0; // private Semaphore clipSemaphore = new Semaphore(1); @@ -378,16 +378,22 @@ super.open(format); this.data = new byte[bufferSize]; System.arraycopy(data, offset, this.data, 0, bufferSize); + frameCount = bufferSize / format.getFrameSize(); currentFrame = 0; framesSinceOpen = 0; + startFrame = 0; endFrame = frameCount - 1; + loopsLeft = 0; + PulseAudioVolumeControl volumeControl = new PulseAudioVolumeControl( this, eventLoop); PulseAudioMuteControl muteControl = new PulseAudioMuteControl(this, volumeControl); controls.add(volumeControl); controls.add(muteControl); + volume = volumeControl.getValue(); + muted = muteControl.getValue(); PulseAudioMixer mixer = PulseAudioMixer.getInstance(); mixer.addSourceLine(this);