ASF Bugzilla – Attachment 24906 Details for
Bug 48637
[PATCH] sound task either does nothing or endlessly loops sound.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch against 1.8.0RC1 to fix both issues (and fix some comment spelling) - PLUS no more busy-waits.
ant-1.8.0rc1-fix-48637-sound-v2.patch (text/plain), 1.43 KB, created by
Ed Brannin
on 2010-01-29 08:02:54 UTC
(
hide
)
Description:
Patch against 1.8.0RC1 to fix both issues (and fix some comment spelling) - PLUS no more busy-waits.
Filename:
MIME Type:
Creator:
Ed Brannin
Created:
2010-01-29 08:02:54 UTC
Size:
1.43 KB
patch
obsolete
>diff -r addcd3c64cd1 src/main/org/apache/tools/ant/taskdefs/optional/sound/AntSoundPlayer.java >--- a/src/main/org/apache/tools/ant/taskdefs/optional/sound/AntSoundPlayer.java Fri Jan 29 10:05:49 2010 -0500 >+++ b/src/main/org/apache/tools/ant/taskdefs/optional/sound/AntSoundPlayer.java Fri Jan 29 11:02:32 2010 -0500 >@@ -41,7 +42,7 @@ > * This class is designed to be used by any AntTask that requires audio output. > * > * It implements the BuildListener interface to listen for BuildEvents and could >- * be easily extended to provide audio output upon any specific build events occuring. >+ * be easily extended to provide audio output upon any specific build events occurring. > * > * I have only tested this with .WAV and .AIFF sound file formats. Both seem to work fine. > * >@@ -139,9 +139,14 @@ > private void playClip(Clip clip, int loops) { > > clip.loop(loops); >- while (clip.isRunning()) { >- // Empty block >+ do { >+ try { >+ long timeLeft = (clip.getMicrosecondLength() - clip.getMicrosecondPosition()) / 1000; >+ Thread.sleep(timeLeft); >+ } catch (InterruptedException e) { >+ // Ignore Exception > } >+ } while (clip.isRunning()); > } > > private void playClip(Clip clip, long duration) { >@@ -151,6 +156,7 @@ > } catch (InterruptedException e) { > // Ignore Exception > } >+ clip.stop(); > } > > /**
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 48637
:
24902
|
24905
| 24906 |
24907