X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=debian%2Fpatches%2Fpulse-audio-compat.diff;fp=debian%2Fpatches%2Fpulse-audio-compat.diff;h=5e86d553fc8ed0da139d08563ac1247bff1700c7;hb=734f75e228b246141484b2165d31f2b8e50755a5;hp=0000000000000000000000000000000000000000;hpb=abc1349bc2beb1a491ca454f7792e44bbf66b8c9;p=debian%2Ffreetts diff --git a/debian/patches/pulse-audio-compat.diff b/debian/patches/pulse-audio-compat.diff new file mode 100644 index 0000000..5e86d55 --- /dev/null +++ b/debian/patches/pulse-audio-compat.diff @@ -0,0 +1,58 @@ +Index: freetts-1.2.2/com/sun/speech/freetts/audio/JavaStreamingAudioPlayer.java +=================================================================== +--- freetts-1.2.2.orig/com/sun/speech/freetts/audio/JavaStreamingAudioPlayer.java ++++ freetts-1.2.2/com/sun/speech/freetts/audio/JavaStreamingAudioPlayer.java +@@ -7,6 +7,8 @@ + */ + package com.sun.speech.freetts.audio; + ++import java.util.concurrent.Semaphore; ++ + import javax.sound.sampled.AudioFormat; + import javax.sound.sampled.AudioSystem; + import javax.sound.sampled.DataLine; +@@ -94,7 +96,7 @@ public class JavaStreamingAudioPlayer im + private long openFailDelayMs; + private long totalOpenFailDelayMs; + +- private Object openLock = new Object(); ++ private Semaphore openLock; + private Object lineLock = new Object(); + + +@@ -193,16 +195,14 @@ public class JavaStreamingAudioPlayer im + try { + line = (SourceDataLine) AudioSystem.getLine(info); + line.addLineListener(new JavaStreamLineListener()); +- +- synchronized (openLock) { +- line.open(format, AUDIO_BUFFER_SIZE); +- try { +- openLock.wait(); +- } catch (InterruptedException ie) { +- ie.printStackTrace(); +- } +- opened = true; +- } ++ openLock = new Semaphore(0); ++ line.open(format, AUDIO_BUFFER_SIZE); ++ try { ++ openLock.acquire(); ++ opened = true; ++ } catch (InterruptedException ie) { ++ ie.printStackTrace(); ++ } + } catch (LineUnavailableException lue) { + System.err.println("LINE UNAVAILABLE: " + + "Format is " + currentFormat); +@@ -644,9 +644,7 @@ public class JavaStreamingAudioPlayer im + */ + public void update(LineEvent event) { + if (event.getType().equals(LineEvent.Type.OPEN)) { +- synchronized (openLock) { +- openLock.notifyAll(); +- } ++ openLock.release(); + } + } + }