diff --git a/src/org/jitsi/impl/neomedia/CoreAudioDevice.java b/src/org/jitsi/impl/neomedia/CoreAudioDevice.java index 10345ae6c1ced6d55bbc30104ae7e574004012dd..07230e01b88b55f8d458c1e68fa202586834fbd1 100644 --- a/src/org/jitsi/impl/neomedia/CoreAudioDevice.java +++ b/src/org/jitsi/impl/neomedia/CoreAudioDevice.java @@ -64,9 +64,12 @@ else if (OSUtils.IS_WINDOWS_VISTA public static native void freeDevices(); - public static String getDeviceModelIdentifier( - String deviceUID) + public static String getDeviceModelIdentifier(String deviceUID) { + // Prevent an access violation in getDeviceModelIdentifierBytes. + if (deviceUID == null) + throw new NullPointerException("deviceUID"); + byte[] deviceModelIdentifierBytes = getDeviceModelIdentifierBytes(deviceUID); String deviceModelIdentifier diff --git a/src/org/jitsi/impl/neomedia/device/PortAudioSystem.java b/src/org/jitsi/impl/neomedia/device/PortAudioSystem.java index 50a6608bea8ebc38654fbc8d9fb6c56f7e6e7570..9b99e2e6758a65014ccb89e4407787ffaa98b6ea 100644 --- a/src/org/jitsi/impl/neomedia/device/PortAudioSystem.java +++ b/src/org/jitsi/impl/neomedia/device/PortAudioSystem.java @@ -548,12 +548,22 @@ protected void doInitialize() = Pa.DeviceInfo_getTransportType(deviceInfo); String deviceUID = Pa.DeviceInfo_getDeviceUID(deviceInfo); - String modelIdentifier = null; - if(CoreAudioDevice.isLoaded) + String modelIdentifier; + String locatorRemainder; + + if (deviceUID == null) + { + modelIdentifier = null; + locatorRemainder = name; + } + else + { modelIdentifier - = CoreAudioDevice.getDeviceModelIdentifier(deviceUID); - String deviceLocatorID - = (deviceUID != null)? deviceUID: name; + = CoreAudioDevice.isLoaded + ? CoreAudioDevice.getDeviceModelIdentifier(deviceUID) + : null; + locatorRemainder = deviceUID; + } /* * TODO The intention of reinitialize() was to perform the @@ -589,7 +599,7 @@ protected void doInitialize() = new CaptureDeviceInfo2( name, new MediaLocator( - LOCATOR_PROTOCOL + ":#" + deviceLocatorID), + LOCATOR_PROTOCOL + ":#" + locatorRemainder), new Format[] { new AudioFormat(