patch from Keith to improve pulse audio support debian/1.2.2-4
authorBdale Garbee <bdale@gag.com>
Mon, 2 Oct 2017 16:36:04 +0000 (10:36 -0600)
committerBdale Garbee <bdale@gag.com>
Mon, 2 Oct 2017 16:36:04 +0000 (10:36 -0600)
debian/changelog
debian/patches/pulse-audio-compat.diff [new file with mode: 0644]
debian/patches/series

index 8f7db10b6c1eb26e7f5d7773bceeeae0f741a790..e3457deae803161858d7b2746713991320bdb637 100644 (file)
@@ -1,3 +1,13 @@
+freetts (1.2.2-4) unstable; urgency=low
+
+  [ Keith Packard ]
+  * make upstream-relevant patch so freetts works with PulseAudio
+
+  [ Bdale Garbee ]
+  * update package to current standards, fix lintian warnings, etc
+
+ -- Bdale Garbee <bdale@gag.com>  Mon, 02 Oct 2017 10:35:25 -0600
+
 freetts (1.2.2-3) unstable; urgency=low
 
   * make git-buildpackage point to the right "upstream" branch
diff --git a/debian/patches/pulse-audio-compat.diff b/debian/patches/pulse-audio-compat.diff
new file mode 100644 (file)
index 0000000..5e86d55
--- /dev/null
@@ -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();
+             }
+         }
+     }
index f3fd9f9fffcf2fa9b6a74b0ab9b98ee6f59ab6ee..41287972a73f953d8a2794c0f120fe28e6422165 100644 (file)
@@ -1,2 +1,3 @@
 license.terms-missing.diff
 debian-build-target.diff
+pulse-audio-compat.diff