SUGGESTED FIX
--- old/make/javax/sound/Makefile Thu Mar 6 14:20:52 2008
+++ new/make/javax/sound/Makefile Thu Mar 6 14:20:52 2008
@@ -58,11 +58,16 @@
#
ifdef OPENJDK
+ # skip closed lib if the flag is set
+ ifeq ($(IMPORT_BINARY_PLUGS),true)
+
# copy closed .class files
-build: import-binary-plug-sound-classes
+build: import-binary-plug-sound-classes
include $(BUILDDIR)/common/internal/BinaryPlugs.gmk
+ endif # IMPORT_BINARY_PLUGS
+
endif # OPENJDK
#
@@ -98,7 +103,13 @@
#
# add "closed" library
#
-SUBDIRS += jsoundhs
+ifdef OPENJDK
+ ifeq ($(IMPORT_BINARY_PLUGS),true)
+ SUBDIRS += jsoundhs
+ endif # IMPORT_BINARY_PLUGS
+else
+ SUBDIRS += jsoundhs
+endif # OPENJDK
#
# system dependent flags
--- old/src/share/classes/com/sun/media/sound/AbstractMidiDevice.java Thu Mar 6 14:20:53 2008
+++ new/src/share/classes/com/sun/media/sound/AbstractMidiDevice.java Thu Mar 6 14:20:53 2008
@@ -75,13 +75,6 @@
/**
* This is the device handle returned from native code
*/
- /*
- * $$rratta Solaris 64 bit holds pointer must be long
- *
- * $$mp 2003-08-07:
- * 'id' is a really bad name. The variable should
- * be called nativePointer or something similar.
- */
protected long id = 0;
@@ -586,7 +579,6 @@
private ArrayList<Transmitter> transmitters = new ArrayList<Transmitter>();
private MidiOutDevice.MidiOutReceiver midiOutReceiver;
- private MixerSynth.SynthReceiver mixerSynthReceiver;
// how many transmitters must be present for optimized
// handling
@@ -621,22 +613,14 @@
if (midiOutReceiver == oldR) {
midiOutReceiver = null;
}
- if (mixerSynthReceiver == oldR) {
- mixerSynthReceiver = null;
- }
if (newR != null) {
if ((newR instanceof MidiOutDevice.MidiOutReceiver)
&& (midiOutReceiver == null)) {
midiOutReceiver = ((MidiOutDevice.MidiOutReceiver) newR);
}
- if ((newR instanceof MixerSynth.SynthReceiver)
- && (mixerSynthReceiver == null)) {
- mixerSynthReceiver = ((MixerSynth.SynthReceiver) newR);
- }
}
optimizedReceiverCount =
- ((midiOutReceiver!=null)?1:0)
- + ((mixerSynthReceiver!=null)?1:0);
+ ((midiOutReceiver!=null)?1:0);
}
// more potential for optimization here
}
@@ -670,10 +654,6 @@
if (TRACE_TRANSMITTER) Printer.println("Sending packed message to MidiOutReceiver");
midiOutReceiver.sendPackedMidiMessage(packedMessage, timeStamp);
}
- if (mixerSynthReceiver != null) {
- if (TRACE_TRANSMITTER) Printer.println("Sending packed message to MixerSynthReceiver");
- mixerSynthReceiver.sendPackedMidiMessage(packedMessage, timeStamp);
- }
} else {
if (TRACE_TRANSMITTER) Printer.println("Sending packed message to "+size+" transmitter's receivers");
for (int i = 0; i < size; i++) {
@@ -682,9 +662,6 @@
if (optimizedReceiverCount > 0) {
if (receiver instanceof MidiOutDevice.MidiOutReceiver) {
((MidiOutDevice.MidiOutReceiver) receiver).sendPackedMidiMessage(packedMessage, timeStamp);
- }
- else if (receiver instanceof MixerSynth.SynthReceiver) {
- ((MixerSynth.SynthReceiver) receiver).sendPackedMidiMessage(packedMessage, timeStamp);
} else {
receiver.send(new FastShortMessage(packedMessage), timeStamp);
}
@@ -739,10 +716,6 @@
if (TRACE_TRANSMITTER) Printer.println("Sending MIDI message to MidiOutReceiver");
midiOutReceiver.send(message, timeStamp);
}
- if (mixerSynthReceiver != null) {
- if (TRACE_TRANSMITTER) Printer.println("Sending MIDI message to MixerSynthReceiver");
- mixerSynthReceiver.send(message, timeStamp);
- }
} else {
if (TRACE_TRANSMITTER) Printer.println("Sending MIDI message to "+size+" transmitter's receivers");
for (int i = 0; i < size; i++) {
--- old/src/share/classes/com/sun/media/sound/Platform.java Thu Mar 6 14:20:53 2008
+++ new/src/share/classes/com/sun/media/sound/Platform.java Thu Mar 6 14:20:53 2008
@@ -158,14 +158,20 @@
if(Printer.trace)Printer.trace(">>Platform.loadLibraries");
try {
- // load the main libraries
+ // load the main library
JSSecurityManager.loadLibrary(libNameMain);
- JSSecurityManager.loadLibrary(libNameMain2);
// just for the heck of it...
loadedLibs |= LIB_MAIN;
+ // load "closed" library
+ JSSecurityManager.loadLibrary(libNameMain2);
} catch (SecurityException e) {
if(Printer.err)Printer.err("Security exception loading main native library. JavaSound requires access to these resources.");
throw(e);
+ } catch (UnsatisfiedLinkError e) {
+ // libNameMain2 may be absent!
+ if ((loadedLibs & LIB_MAIN) != LIB_MAIN) {
+ throw(e);
+ }
}
// now try to load extra libs. They are defined at compile time in the Makefile
--- old/src/share/classes/com/sun/media/sound/RealTimeSequencer.java Thu Mar 6 14:20:54 2008
+++ new/src/share/classes/com/sun/media/sound/RealTimeSequencer.java Thu Mar 6 14:20:54 2008
@@ -146,7 +146,7 @@
/** for RMF media we need the RMF sequencer */
- private MixerSequencer seqBridge = null;
+ private Sequencer seqBridge = null;
/** automatic connection support */
private boolean autoConnect = false;
@@ -259,7 +259,12 @@
// seems to be RMF
if (seqBridge == null) {
try {
- seqBridge = new MixerSequencer();
+ try {
+ Class cls = Class.forName("com.sun.media.sound.MixerSequencer");
+ seqBridge = (Sequencer)cls.newInstance();
+ } catch (Exception ex) {
+ throw new InvalidMidiDataException();
+ }
if (isOpen()) {
seqBridge.open();
}
|