changeset in /hg/icedtea: Import Gervill CVS fixes.

Mark Wielaard mark at klomp.org
Sun Jun 22 12:34:43 PDT 2008


changeset 94f0c8f3a4aa in /hg/icedtea
details: http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=94f0c8f3a4aa
description:
	Import Gervill CVS fixes.

	2008-08-08  Mark Wielaard  <mark at klomp.org>

	       * overlays/openjdk/jdk/src/share/classes/com/sun/media/sound:
	       Import Gervill fixes from CVS. See CHANGES.txt.
	       * overlays/openjdk/jdk/test/com/sun/media/sound: Likewise.

	- Cleanup: Make inner classes static
	           AudioFloatFormatConverter.AudioFloatFormatConverterInputStream
	           AudioFloatFormatConverter.AudioFloatInputStreamChannelMixer
	           AudioFloatFormatConverter.AudioFloatInputStreamResampler
	           SimpleInstrument.SimpleInstrumentPart
	           SoftChorus.VariableDelay
	           SoftChorus.LFODelay
	           SoftMixingDataLine.AudioFloatInputStreamResampler
	           SoftMixingSourceDataLine.NonBlockingFloatInputStream
	           SoftReverb.AllPass
	           SoftReverb.Comb
	           SoftReverb.Delay
	- Cleanup: Remove unused fields in:
	           SoftSincResampler.din, SoftLanczosResampler.din,
	           SoftMainMixer.finetuning,  SoftMainMixer.coarsetuning
	           SoftJitterCorrector.JitterStream.nullbuff,
	           SoftAbstractResampler.ModelAbstractResampler.loopread
	           SoftAbstractResampler.ModelAbstractResampler.streammarked
	- Cleanup: Remove dead code from FFT.
	- Cleanup: Make constant fields in SoftFilter final.
	- Cleanup: Let SoftSynthesizer.info be final.
	- Cleanup: Let SoftProvider.info be final.
	- Fix: Unnecessary call to sourceDataLine.drain() in SoftSynthesizer
	       causes random hangs in SoftSynthesizer.open jtreg test.
	       This happens when the synthesizer is opened and right after closed.
	       This will not happen if there is a delay between open and close call.
	- Fix: ModelByteBufferAudioFileSoundbankReader,
	       SoftAudioPusher, SoftJitterCorrector
	       don't ignore stream.read return value.
	- Fix: NullPointerException in
	       SoftSynthesizer.unloadInstrument if instrument = null
	- Fix: SoftJitterCorrector.getSoundbank(URL) may fail to close stream.
	- Fix: Futile attempts to guard buffers variable in SoftJitterCorrector.
	- Fix: RiffReader/SF2SoundbankReader/DLSSoundbank should use readfully instead of read
	       when reading from stream.
	       JTreg tests where created to test for this.

diffstat:

49 files changed, 844 insertions(+), 203 deletions(-)
ChangeLog                                                                                              |    6 
overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/AudioFileSoundbankReader.java               |   80 +++---
overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/AudioFloatConverter.java                    |    2 
overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/AudioFloatFormatConverter.java              |   12 -
overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/CHANGES.txt                                 |   37 +++
overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/DLSSoundbank.java                           |   60 ++---
overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/EmergencySoundbank.java                     |    2 
overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/FFT.java                                    |    1 
overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/JARSoundbankReader.java                     |   32 +-
overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/ModelByteBuffer.java                        |    9 
overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/ModelByteBufferWavetable.java               |    1 
overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/ModelIdentifier.java                        |    6 
overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/README.txt                                  |    3 
overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/RIFFReader.java                             |   49 +++-
overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SF2Soundbank.java                           |    8 
overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SimpleInstrument.java                       |    2 
overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftAbstractResampler.java                  |    5 
overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftAudioPusher.java                        |   10 
overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftChorus.java                             |    4 
overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftFilter.java                             |   26 +-
overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftInstrument.java                         |    6 
overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftJitterCorrector.java                    |   21 +
overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftLanczosResampler.java                   |    2 
overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftMainMixer.java                          |    4 
overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftMixingDataLine.java                     |    2 
overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftMixingMixer.java                        |    2 
overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftMixingMixerProvider.java                |    6 
overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftMixingSourceDataLine.java               |    6 
overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftProvider.java                           |    2 
overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftReverb.java                             |    6 
overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftSincResampler.java                      |    2 
overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/SoftSynthesizer.java                        |   13 -
overlays/openjdk/jdk/test/com/sun/media/sound/DLSSoundbankReader/TestGetSoundbankFile.java             |   52 ++++
overlays/openjdk/jdk/test/com/sun/media/sound/DLSSoundbankReader/TestGetSoundbankInputStream.java      |   63 +++++
overlays/openjdk/jdk/test/com/sun/media/sound/DLSSoundbankReader/TestGetSoundbankInputStream2.java     |  119 ++++++++++
overlays/openjdk/jdk/test/com/sun/media/sound/DLSSoundbankReader/TestGetSoundbankUrl.java              |   54 ++++
overlays/openjdk/jdk/test/com/sun/media/sound/SF2SoundbankReader/TestGetSoundbankFile.java             |   52 ++++
overlays/openjdk/jdk/test/com/sun/media/sound/SF2SoundbankReader/TestGetSoundbankInputStream.java      |   63 +++++
overlays/openjdk/jdk/test/com/sun/media/sound/SF2SoundbankReader/TestGetSoundbankInputStream2.java     |  119 ++++++++++
overlays/openjdk/jdk/test/com/sun/media/sound/SF2SoundbankReader/TestGetSoundbankUrl.java              |   54 ++++
overlays/openjdk/jdk/test/com/sun/media/sound/SoftLimiter/ProcessAudio_replace_mix.java                |    3 
overlays/openjdk/jdk/test/com/sun/media/sound/SoftLimiter/ProcessAudio_replace_mix_mono.java           |    3 
overlays/openjdk/jdk/test/com/sun/media/sound/SoftLimiter/ProcessAudio_replace_mix_mono_overdrive.java |    3 
overlays/openjdk/jdk/test/com/sun/media/sound/SoftLimiter/ProcessAudio_replace_mix_overdrive.java      |    3 
overlays/openjdk/jdk/test/com/sun/media/sound/SoftLimiter/ProcessAudio_replace_normal.java             |    3 
overlays/openjdk/jdk/test/com/sun/media/sound/SoftLimiter/ProcessAudio_replace_normal_mono.java        |    3 
overlays/openjdk/jdk/test/com/sun/media/sound/SoftLimiter/ProcessAudio_replace_overdrive.java          |    3 
overlays/openjdk/jdk/test/com/sun/media/sound/SoftLimiter/ProcessAudio_replace_overdrive_mono.java     |    3 
overlays/openjdk/jdk/test/com/sun/media/sound/SoftSynthesizer/TestRender1.java                         |   20 +

diffs (truncated from 1938 to 500 lines):

diff -r e4b644655e78 -r 94f0c8f3a4aa ChangeLog
--- a/ChangeLog	Sun Jun 08 18:51:47 2008 +0200
+++ b/ChangeLog	Sun Jun 08 21:21:14 2008 +0200
@@ -1,3 +1,9 @@ 2008-06-08  Mark Wielaard  <mark at klomp.o
+2008-06-08  Mark Wielaard  <mark at klomp.org>
+
+	* overlays/openjdk/jdk/src/share/classes/com/sun/media/sound:
+	Import Gervill fixes from CVS. See CHANGES.txt.
+	* overlays/openjdk/jdk/test/com/sun/media/sound: Likewise.
+
 2008-06-08  Mark Wielaard  <mark at klomp.org>
 
 	* Makefile.am (ZERO_PATCHES): Add
diff -r e4b644655e78 -r 94f0c8f3a4aa overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/AudioFileSoundbankReader.java
--- a/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/AudioFileSoundbankReader.java	Sun Jun 08 18:51:47 2008 +0200
+++ b/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/AudioFileSoundbankReader.java	Sun Jun 08 21:21:14 2008 +0200
@@ -26,6 +26,7 @@ package com.sun.media.sound;
 package com.sun.media.sound;
 
 import java.io.ByteArrayOutputStream;
+import java.io.DataInputStream;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
@@ -41,7 +42,7 @@ import javax.sound.sampled.UnsupportedAu
 /**
  * Soundbank reader that uses audio files as soundbanks.
  * 
- * @version %I%, %E% 
+ * @version %I%, %E%
  * @author Karl Helgason
  * 
  */
@@ -81,34 +82,32 @@ public class AudioFileSoundbankReader ex
 			throws InvalidMidiDataException, IOException {
 
 		try {
-			try {
-				byte[] buffer;
-				if (ais.getFrameLength() == -1) {
-					ByteArrayOutputStream baos = new ByteArrayOutputStream();
-					byte[] buff = new byte[1024 - (1024 % ais.getFormat().getFrameSize())];
-					int ret;
-					while ((ret = ais.read(buff)) != -1)
-						baos.write(buff, 0, ret);
-					ais.close();
-					buffer = baos.toByteArray();
-				} else {
-					buffer = new byte[(int) (ais.getFrameLength() * ais
-							.getFormat().getFrameSize())];
-					ais.read(buffer);
-				}
-				ModelByteBufferWavetable osc = new ModelByteBufferWavetable(
-						new ModelByteBuffer(buffer), ais.getFormat(), -4800);
-				ModelPerformer performer = new ModelPerformer();
-				;
-				performer.getOscillators().add(osc);
+			byte[] buffer;
+			if (ais.getFrameLength() == -1) {
+				ByteArrayOutputStream baos = new ByteArrayOutputStream();
+				byte[] buff = new byte[1024 - (1024 % ais.getFormat()
+						.getFrameSize())];
+				int ret;
+				while ((ret = ais.read(buff)) != -1)
+					baos.write(buff, 0, ret);
+				ais.close();
+				buffer = baos.toByteArray();
+			} else {
+				buffer = new byte[(int) (ais.getFrameLength() * ais.getFormat()
+						.getFrameSize())];
+				new DataInputStream(ais).readFully(buffer);
+			}
+			ModelByteBufferWavetable osc = new ModelByteBufferWavetable(
+					new ModelByteBuffer(buffer), ais.getFormat(), -4800);
+			ModelPerformer performer = new ModelPerformer();
+			;
+			performer.getOscillators().add(osc);
 
-				SimpleSoundbank sbk = new SimpleSoundbank();
-				SimpleInstrument ins = new SimpleInstrument();
-				ins.add(performer);
-				sbk.addInstrument(ins);
-				return sbk;
-			} finally {
-			}
+			SimpleSoundbank sbk = new SimpleSoundbank();
+			SimpleInstrument ins = new SimpleInstrument();
+			ins.add(performer);
+			sbk.addInstrument(ins);
+			return sbk;
 		} catch (Exception e) {
 			return null;
 		}
@@ -117,18 +116,18 @@ public class AudioFileSoundbankReader ex
 	public Soundbank getSoundbank(File file) throws InvalidMidiDataException,
 			IOException {
 
-		try {									
-				AudioInputStream ais = AudioSystem.getAudioInputStream(file);
-				ais.close();
-				ModelByteBufferWavetable osc = new ModelByteBufferWavetable(
+		try {
+			AudioInputStream ais = AudioSystem.getAudioInputStream(file);
+			ais.close();
+			ModelByteBufferWavetable osc = new ModelByteBufferWavetable(
 					new ModelByteBuffer(file, 0, file.length()), -4800);
-				ModelPerformer performer = new ModelPerformer();				
-				performer.getOscillators().add(osc);
-				SimpleSoundbank sbk = new SimpleSoundbank();
-				SimpleInstrument ins = new SimpleInstrument();
-				ins.add(performer);
-				sbk.addInstrument(ins);
-				return sbk;							
+			ModelPerformer performer = new ModelPerformer();
+			performer.getOscillators().add(osc);
+			SimpleSoundbank sbk = new SimpleSoundbank();
+			SimpleInstrument ins = new SimpleInstrument();
+			ins.add(performer);
+			sbk.addInstrument(ins);
+			return sbk;
 		} catch (UnsupportedAudioFileException e1) {
 			return null;
 		} catch (IOException e) {
@@ -136,6 +135,5 @@ public class AudioFileSoundbankReader ex
 		}
 
 	}
-	
-	
+
 }
diff -r e4b644655e78 -r 94f0c8f3a4aa overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/AudioFloatConverter.java
--- a/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/AudioFloatConverter.java	Sun Jun 08 18:51:47 2008 +0200
+++ b/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/AudioFloatConverter.java	Sun Jun 08 21:21:14 2008 +0200
@@ -923,7 +923,7 @@ public abstract class AudioFloatConverte
 				if (format.getSampleSizeInBits() <= 8)
 					conv = new AudioFloatConversion8S();
 				else if (format.getSampleSizeInBits() > 8
-						& format.getSampleSizeInBits() <= 16)
+						&& format.getSampleSizeInBits() <= 16)
 					conv = new AudioFloatConversion16SL();
 				else if (format.getSampleSizeInBits() > 16
 						&& format.getSampleSizeInBits() <= 24)
diff -r e4b644655e78 -r 94f0c8f3a4aa overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/AudioFloatFormatConverter.java
--- a/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/AudioFloatFormatConverter.java	Sun Jun 08 18:51:47 2008 +0200
+++ b/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/AudioFloatFormatConverter.java	Sun Jun 08 21:21:14 2008 +0200
@@ -47,7 +47,7 @@ import javax.sound.sampled.spi.FormatCon
 
 public class AudioFloatFormatConverter extends FormatConversionProvider {
 
-	private class AudioFloatFormatConverterInputStream extends InputStream
+	private static class AudioFloatFormatConverterInputStream extends InputStream
 	{
 		private AudioFloatConverter converter;
 		private AudioFloatInputStream stream;
@@ -109,7 +109,7 @@ public class AudioFloatFormatConverter e
 		
 	}
 	
-	private class AudioFloatInputStreamChannelMixer extends AudioFloatInputStream
+	private static class AudioFloatInputStreamChannelMixer extends AudioFloatInputStream
 	{
 		
 		private int targetChannels;
@@ -217,7 +217,7 @@ public class AudioFloatFormatConverter e
 		
 	}
 	
-	private class AudioFloatInputStreamResampler extends AudioFloatInputStream
+	private static class AudioFloatInputStreamResampler extends AudioFloatInputStream
 	{
 		
 		private AudioFloatInputStream ais;
@@ -476,16 +476,16 @@ public class AudioFloatFormatConverter e
 	}	
 
 	public Encoding[] getSourceEncodings() {
-		return formats;
+		return new Encoding[] {Encoding.PCM_SIGNED, Encoding.PCM_UNSIGNED, AudioFloatConverter.PCM_FLOAT};
 	}
 
 	public Encoding[] getTargetEncodings() {
-		return formats;
+		return new Encoding[] {Encoding.PCM_SIGNED, Encoding.PCM_UNSIGNED, AudioFloatConverter.PCM_FLOAT};
 	}
 
 	public Encoding[] getTargetEncodings(AudioFormat sourceFormat) {
 		if(AudioFloatConverter.getConverter(sourceFormat) == null) return new Encoding[0]; 
-		return formats;
+		return new Encoding[] {Encoding.PCM_SIGNED, Encoding.PCM_UNSIGNED, AudioFloatConverter.PCM_FLOAT};
 	}
 
 	public AudioFormat[] getTargetFormats(Encoding targetEncoding, AudioFormat sourceFormat) {
diff -r e4b644655e78 -r 94f0c8f3a4aa overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/CHANGES.txt
--- a/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/CHANGES.txt	Sun Jun 08 18:51:47 2008 +0200
+++ b/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/CHANGES.txt	Sun Jun 08 21:21:14 2008 +0200
@@ -1,3 +1,39 @@
+  - Cleanup: Make inner classes static 
+              AudioFloatFormatConverter.AudioFloatFormatConverterInputStream
+              AudioFloatFormatConverter.AudioFloatInputStreamChannelMixer
+              AudioFloatFormatConverter.AudioFloatInputStreamResampler
+              SimpleInstrument.SimpleInstrumentPart
+              SoftChorus.VariableDelay
+              SoftChorus.LFODelay
+              SoftMixingDataLine.AudioFloatInputStreamResampler
+              SoftMixingSourceDataLine.NonBlockingFloatInputStream
+              SoftReverb.AllPass
+              SoftReverb.Comb
+              SoftReverb.Delay
+  - Cleanup: Remove unused fields in:
+              SoftSincResampler.din, SoftLanczosResampler.din, 
+              SoftMainMixer.finetuning,  SoftMainMixer.coarsetuning
+              SoftJitterCorrector.JitterStream.nullbuff, 
+              SoftAbstractResampler.ModelAbstractResampler.loopread
+              SoftAbstractResampler.ModelAbstractResampler.streammarked
+  - Cleanup: Remove dead code from FFT.
+  - Cleanup: Make constant fields in SoftFilter final.
+  - Cleanup: Let SoftSynthesizer.info be final.
+  - Cleanup: Let SoftProvider.info be final.
+  - Fix: Unnecessary call to sourceDataLine.drain() in SoftSynthesizer 
+         causes random hangs in SoftSynthesizer.open jtreg test.
+         This happens when the synthesizer is opened and right after closed.
+         This will not happen if there is a delay between open and close call.
+  - Fix: ModelByteBufferAudioFileSoundbankReader, 
+         SoftAudioPusher, SoftJitterCorrector
+          don't ignore stream.read return value.
+  - Fix: NullPointerException in 
+         SoftSynthesizer.unloadInstrument if instrument = null       
+  - Fix: SoftJitterCorrector.getSoundbank(URL) may fail to close stream.
+  - Fix: Futile attempts to guard buffers variable in SoftJitterCorrector.
+  - Fix: RiffReader/SF2SoundbankReader/DLSSoundbank should use readfully instead of read 
+         when reading from stream.
+         JTreg tests where created to test for this.
   - Added: Software Mixing Mixer
   - Removed: PATSoundBankReader removed because no format license is available.
              It is also undocumented format. 
@@ -22,6 +58,7 @@
          If illegal notenumber was used in NoteOn/NoteOff
          a ArrayOutOfIndex exception was thrown.
          
+Version 1.0 (released in OpenJDK 6 b10)
   - Fix: Default tempo in SoftMidiFileReader was supposed to be 500000 mpq or 120 bpm
   - Fix: Change type of info variable in SoftSynthesize into MidiDevice.Info
   - Fix: Fix instanceof check of p1 variable in ModelInstrumentComparator
diff -r e4b644655e78 -r 94f0c8f3a4aa overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/DLSSoundbank.java
--- a/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/DLSSoundbank.java	Sun Jun 08 18:51:47 2008 +0200
+++ b/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/DLSSoundbank.java	Sun Jun 08 21:21:14 2008 +0200
@@ -111,6 +111,10 @@ public class DLSSoundbank implements Sou
 			return d;
 		}
 		
+		public int hashCode() {
+			return (int)i1;
+		}
+				
 		public boolean equals(Object obj) {
 			if(!(obj instanceof DLSID)) return false;
 			DLSID t = (DLSID)obj;
@@ -230,15 +234,15 @@ public class DLSSoundbank implements Sou
 					if(!readCdlChunk(chunk))
 						throw new RIFFInvalidFormatException("DLS file isn't supported!");
 				}
-				if (chunk.getFormat().equals("colh")) {
+				//if (chunk.getFormat().equals("colh")) {
 					// - skipped because we will load the entire bank into memory
 					// long instrumentcount = chunk.readUnsignedInt();
 					// System.out.println("instrumentcount = "+ instrumentcount);					
-				}
-				if (chunk.getFormat().equals("ptbl")) {
+				//}
+				//if (chunk.getFormat().equals("ptbl")) {
 					// Pool Table Chunk
 					// - skipped because we will load the entire bank into memory
-				}	
+				//}	
 				if (chunk.getFormat().equals("vers")) {
 					major = chunk.readUnsignedInt();
 					minor = chunk.readUnsignedInt();
@@ -300,80 +304,80 @@ public class DLSSoundbank implements Sou
 			case DLS_CDL_AND:
 				x = stack.pop();
 				y = stack.pop();
-				stack.push(new Long( ((x!=0) & (y!=0)) ?1:0));
+				stack.push(Long.valueOf( ((x!=0) && (y!=0)) ?1:0));
 				break;
 			case DLS_CDL_OR:
 				x = stack.pop();
 				y = stack.pop();
-				stack.push(new Long( ((x!=0) | (y!=0)) ?1:0));
+				stack.push(Long.valueOf( ((x!=0) || (y!=0)) ?1:0));
 				break;
 			case DLS_CDL_XOR:
 				x = stack.pop();
 				y = stack.pop();
-				stack.push(new Long( ((x!=0) ^ (y!=0)) ?1:0));
+				stack.push(Long.valueOf( ((x!=0) ^ (y!=0)) ?1:0));
 				break;
 			case DLS_CDL_ADD:
 				x = stack.pop();
 				y = stack.pop();
-				stack.push(new Long( x+y ));
+				stack.push(Long.valueOf( x+y ));
 				break;
 			case DLS_CDL_SUBTRACT:
 				x = stack.pop();
 				y = stack.pop();
-				stack.push(new Long( x-y ));
+				stack.push(Long.valueOf( x-y ));
 				break;
 			case DLS_CDL_MULTIPLY:
 				x = stack.pop();
 				y = stack.pop();
-				stack.push(new Long( x*y ));
+				stack.push(Long.valueOf( x*y ));
 				break;
 			case DLS_CDL_DIVIDE:
 				x = stack.pop();
 				y = stack.pop();
-				stack.push(new Long( x/y ));
+				stack.push(Long.valueOf( x/y ));
 				break;
 			case DLS_CDL_LOGICAL_AND:
 				x = stack.pop();
 				y = stack.pop();
-				stack.push(new Long( ((x!=0) & (y!=0)) ?1:0));
+				stack.push(Long.valueOf( ((x!=0) && (y!=0)) ?1:0));
 				break;
 			case DLS_CDL_LOGICAL_OR:
 				x = stack.pop();
 				y = stack.pop();
-				stack.push(new Long( ((x!=0) | (y!=0)) ?1:0));
+				stack.push(Long.valueOf( ((x!=0) || (y!=0)) ?1:0));
 				break;
 			case DLS_CDL_LT:
 				x = stack.pop();
 				y = stack.pop();
-				stack.push(new Long( (x < y) ?1:0));
+				stack.push(Long.valueOf( (x < y) ?1:0));
 				break;				
 			case DLS_CDL_LE:
 				x = stack.pop();
 				y = stack.pop();
-				stack.push(new Long( (x <= y) ?1:0));
+				stack.push(Long.valueOf( (x <= y) ?1:0));
 				break;				
 			case DLS_CDL_GT:
 				x = stack.pop();
 				y = stack.pop();
-				stack.push(new Long( (x > y) ?1:0));
+				stack.push(Long.valueOf( (x > y) ?1:0));
 				break;				
 			case DLS_CDL_GE:
 				x = stack.pop();
 				y = stack.pop();
-				stack.push(new Long( (x >= y) ?1:0));
+				stack.push(Long.valueOf( (x >= y) ?1:0));
 				break;				
 			case DLS_CDL_EQ:
 				x = stack.pop();
 				y = stack.pop();
-				stack.push(new Long( (x == y) ?1:0));
+				stack.push(Long.valueOf( (x == y) ?1:0));
 				break;		
 			case DLS_CDL_NOT:
 				x = stack.pop();
 				y = stack.pop();
-				stack.push(new Long((x==0)?1:0));
+				stack.push(Long.valueOf((x==0)?1:0));
 				break;
 			case DLS_CDL_CONST:
-				stack.push(new Long(riff.readUnsignedInt()));
+				stack.push(Long.valueOf(riff.readUnsignedInt()));
 				break;
 			case DLS_CDL_QUERY:
 				uuid = DLSID.read(riff);
@@ -381,7 +385,7 @@ public class DLSSoundbank implements Sou
 				break;				
 			case DLS_CDL_QUERYSUPPORTED:
 				uuid = DLSID.read(riff);
-				stack.push(new Long(cdlIsQuerySupported(uuid)?1:0));
+				stack.push(Long.valueOf(cdlIsQuerySupported(uuid)?1:0));
 				break;				
 			default:
 				break;
@@ -527,7 +531,7 @@ public class DLSSoundbank implements Sou
 				if(format.equals("dlid"))
 				{
 					instrument.guid = new byte[16];
-					chunk.read(instrument.guid);	
+					chunk.readFully(instrument.guid);	
 				}
 				if(format.equals("insh"))
 				{
@@ -559,7 +563,7 @@ public class DLSSoundbank implements Sou
 		long size = riff.readUnsignedInt();
 		long count = riff.readUnsignedInt();
 		
-		if(size - 8 != 0) riff.skip(size - 8);
+		if(size - 8 != 0) riff.skipBytes(size - 8);
 
 		for (int i = 0; i < count; i++) {
 			
@@ -579,7 +583,7 @@ public class DLSSoundbank implements Sou
 		long size = riff.readUnsignedInt();
 		long count = riff.readUnsignedInt();
 		
-		if(size - 8 != 0) riff.skip(size - 8);
+		if(size - 8 != 0) riff.skipBytes(size - 8);
 
 		for (int i = 0; i < count; i++) {
 			
@@ -686,7 +690,7 @@ public class DLSSoundbank implements Sou
 		
 		if(size > 20)
 		{
-			riff.skip(size - 20);
+			riff.skipBytes(size - 20);
 		}
 		
 		for (int i = 0; i < loops; i++) {
@@ -698,7 +702,7 @@ public class DLSSoundbank implements Sou
 			sampleOptions.loops.add(loop);
 			if(size2 > 16)
 			{
-				riff.skip(size2 - 16);
+				riff.skipBytes(size2 - 16);
 			}			
 		}
 	}
@@ -776,7 +780,7 @@ public class DLSSoundbank implements Sou
 				if(format.equals("dlid"))
 				{
 					sample.guid = new byte[16];
-					chunk.read(sample.guid);	
+					chunk.readFully(sample.guid);	
 				}	
 
 				if(format.equals("fmt "))
@@ -936,7 +940,7 @@ public class DLSSoundbank implements Sou
 		List<Long> offsettable = new ArrayList<Long>(); 
 		for (DLSSample sample : samples) 
 		{
-			offsettable.add(new Long(wvpl.getFilePointer() - off));
+			offsettable.add(Long.valueOf(wvpl.getFilePointer() - off));
 			writeSample(wvpl.writeList("wave"), sample);
 		}
 		
diff -r e4b644655e78 -r 94f0c8f3a4aa overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/EmergencySoundbank.java
--- a/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/EmergencySoundbank.java	Sun Jun 08 18:51:47 2008 +0200
+++ b/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/EmergencySoundbank.java	Sun Jun 08 21:21:14 2008 +0200
@@ -49,7 +49,7 @@ import com.sun.media.sound.SF2Soundbank;
  */ 
 public class EmergencySoundbank {
 	
-	public static String[] general_midi_instruments = { 
+	private final static String[] general_midi_instruments = { 
 	"Acoustic Grand Piano",
 	"Bright Acoustic Piano",
 	"Electric Grand Piano",
diff -r e4b644655e78 -r 94f0c8f3a4aa overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/FFT.java
--- a/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/FFT.java	Sun Jun 08 18:51:47 2008 +0200
+++ b/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/FFT.java	Sun Jun 08 21:21:14 2008 +0200
@@ -158,7 +158,6 @@ public final class FFT {
 	private final static void calcF2E(int fftFrameSize, double[] data, int i,
 			int nstep, double[] w) {
 		int jmax = nstep;
-		nstep <<= 1;
 		for (int n = 0; n < jmax; n += 2) {
 			double wr = w[i++];
 			double wi = w[i++];
diff -r e4b644655e78 -r 94f0c8f3a4aa overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/JARSoundbankReader.java
--- a/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/JARSoundbankReader.java	Sun Jun 08 18:51:47 2008 +0200
+++ b/overlays/openjdk/jdk/src/share/classes/com/sun/media/sound/JARSoundbankReader.java	Sun Jun 08 21:21:14 2008 +0200
@@ -82,23 +82,29 @@ public class JARSoundbankReader extends 
 		URLClassLoader ucl = URLClassLoader.newInstance(new URL[] {url});
 		InputStream stream = ucl.getResourceAsStream("META-INF/services/javax.sound.midi.Soundbank");
 		if(stream == null) return null;
-		BufferedReader r = new BufferedReader(new InputStreamReader(stream));
-		String line = r.readLine();
-		while (line != null) {
-			if (!line.startsWith("#")) {
-				try {
-					Class c = Class.forName(line.trim(), true, ucl);
-					Object o = c.newInstance();
-					if (o instanceof Soundbank) {
-						soundbanks.add((Soundbank)o);
+		try
+		{
+			BufferedReader r = new BufferedReader(new InputStreamReader(stream));
+			String line = r.readLine();
+			while (line != null) {
+				if (!line.startsWith("#")) {
+					try {
+						Class c = Class.forName(line.trim(), true, ucl);
+						Object o = c.newInstance();
+						if (o instanceof Soundbank) {
+							soundbanks.add((Soundbank)o);
+						}
+					} catch (Exception e) {
+						e.printStackTrace();



More information about the distro-pkg-dev mailing list