1 Index: freetts-1.2.2/com/sun/speech/freetts/audio/JavaStreamingAudioPlayer.java
2 ===================================================================
3 --- freetts-1.2.2.orig/com/sun/speech/freetts/audio/JavaStreamingAudioPlayer.java
4 +++ freetts-1.2.2/com/sun/speech/freetts/audio/JavaStreamingAudioPlayer.java
7 package com.sun.speech.freetts.audio;
9 +import java.util.concurrent.Semaphore;
11 import javax.sound.sampled.AudioFormat;
12 import javax.sound.sampled.AudioSystem;
13 import javax.sound.sampled.DataLine;
14 @@ -94,7 +96,7 @@ public class JavaStreamingAudioPlayer im
15 private long openFailDelayMs;
16 private long totalOpenFailDelayMs;
18 - private Object openLock = new Object();
19 + private Semaphore openLock;
20 private Object lineLock = new Object();
23 @@ -193,16 +195,14 @@ public class JavaStreamingAudioPlayer im
25 line = (SourceDataLine) AudioSystem.getLine(info);
26 line.addLineListener(new JavaStreamLineListener());
28 - synchronized (openLock) {
29 - line.open(format, AUDIO_BUFFER_SIZE);
32 - } catch (InterruptedException ie) {
33 - ie.printStackTrace();
37 + openLock = new Semaphore(0);
38 + line.open(format, AUDIO_BUFFER_SIZE);
42 + } catch (InterruptedException ie) {
43 + ie.printStackTrace();
45 } catch (LineUnavailableException lue) {
46 System.err.println("LINE UNAVAILABLE: " +
47 "Format is " + currentFormat);
48 @@ -644,9 +644,7 @@ public class JavaStreamingAudioPlayer im
50 public void update(LineEvent event) {
51 if (event.getType().equals(LineEvent.Type.OPEN)) {
52 - synchronized (openLock) {
53 - openLock.notifyAll();