|
View:
New views
1 Messages
—
Rating Filter:
Alert me
|
|
|
<Sound Dev> Further updating Gervill for OpenJDK 6 build 12Hello.
I noticed the Gervill CVS tree has been updated since I last integrated Gervill into OpenJDK 6 [1]. Here is a patch of the current differences: --- old/src/share/classes/com/sun/media/sound/SoftMixingMixer.java Thu Aug 21 21:06:18 2008 +++ new/src/share/classes/com/sun/media/sound/SoftMixingMixer.java Thu Aug 21 21:06:18 2008 @@ -62,7 +62,7 @@ protected static final String INFO_DESCRIPTION = "Software Sound Mixer"; - protected static final String INFO_VERSION = "0.9"; + protected static final String INFO_VERSION = "1.0"; protected final static Mixer.Info info = new Info(); --- old/src/share/classes/com/sun/media/sound/ModelInstrument.java Thu Aug 21 21:06:20 2008 +++ new/src/share/classes/com/sun/media/sound/ModelInstrument.java Thu Aug 21 21:06:20 2008 @@ -88,10 +88,10 @@ // This information is generated from ModelPerformer.getName() // returned from getPerformers(). public String[] getKeys() { - String[] keys = new String[127]; + String[] keys = new String[128]; for (ModelPerformer performer : getPerformers()) { for (int k = performer.getKeyFrom(); k <= performer.getKeyTo(); k++) { - if (keys[k] == null) { + if (k >= 0 && k < 128 && keys[k] == null) { String name = performer.getName(); if (name == null) name = "untitled"; --- old/src/share/classes/com/sun/media/sound/ModelByteBuffer.java Thu Aug 21 21:06:21 2008 +++ new/src/share/classes/com/sun/media/sound/ModelByteBuffer.java Thu Aug 21 21:06:21 2008 @@ -45,7 +45,7 @@ private long fileoffset; private byte[] buffer; private long offset; - private long len; + private final long len; private class RandomFileInputStream extends InputStream { @@ -107,11 +107,12 @@ } public int read(byte[] b) throws IOException { + int len = b.length; if (len > left) len = (int)left; if (left == 0) return -1; - int len = raf.read(b); + len = raf.read(b, 0, len); if (len == -1) return -1; left -= len; @@ -119,12 +120,12 @@ } public int read() throws IOException { - if (len == 0) + if (left == 0) return -1; int b = raf.read(); if (b == -1) return -1; - len--; + left--; return b; } @@ -137,15 +138,15 @@ long beginIndex, long endIndex, boolean independent) { this.root = parent.root; this.offset = 0; - this.len = parent.len; + long parent_len = parent.len; if (beginIndex < 0) beginIndex = 0; - if (beginIndex > len) - beginIndex = len; + if (beginIndex > parent_len) + beginIndex = parent_len; if (endIndex < 0) endIndex = 0; - if (endIndex > len) - endIndex = len; + if (endIndex > parent_len) + endIndex = parent_len; if (beginIndex > endIndex) beginIndex = endIndex; offset = beginIndex; I plan to apply this patch before OpenJDK 6 b12 is published, which should be within a week or two. (Neither the test directory nor the src.floatwav files seem to have been updated since the last integration.) Cheers, -Joe [1] http://mail.openjdk.java.net/pipermail/sound-dev/2008-July/000064.html |
| Free embeddable forum powered by Nabble | Forum Help |