From 9837db67f462c52c927e5de2c6fd5d2ae8e8466c Mon Sep 17 00:00:00 2001
From: Vincent Lucas <chenzo@jitsi.org>
Date: Thu, 20 Dec 2012 15:02:04 +0000
Subject: [PATCH] Enables the media configuration dialog to listen to audio
 system and device changes even if the audio system combo box is disabled (via
 the AUDIO_SYSTEM_DISABLED_PROP portperty).

---
 .../impl/neomedia/device/DeviceConfiguration.java  | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/org/jitsi/impl/neomedia/device/DeviceConfiguration.java b/src/org/jitsi/impl/neomedia/device/DeviceConfiguration.java
index 19078033..14844f55 100644
--- a/src/org/jitsi/impl/neomedia/device/DeviceConfiguration.java
+++ b/src/org/jitsi/impl/neomedia/device/DeviceConfiguration.java
@@ -1049,10 +1049,16 @@ public void propertyChange(PropertyChangeEvent event)
         else if (DeviceSystem.PROP_DEVICES.equals(propertyName))
         {
             if (event.getSource() instanceof AudioSystem)
+            {
+                // Try to switch to a new active audio system if we are
+                // currently using the "none" system.
+                switchFromNoneToActiveAudioSystem(
+                        (CaptureDeviceInfo) event.getNewValue());
                 firePropertyChange(
                         PROP_AUDIO_SYSTEM_DEVICES,
                         event.getOldValue(),
                         event.getNewValue());
+            }
         }
         else if (PROP_VIDEO_FRAMERATE.equals(propertyName))
         {
@@ -1237,5 +1243,13 @@ && getAudioSystem().getLocatorProtocol().equals(
                 }
             }
         }
+        // The device has been unplugged checks. It may be good to check if the
+        // current active audio system still have actvie devices. If not, then
+        // we will choose another audio system, or the "none" one if no audio
+        // system is available.
+        else
+        {
+            extractConfiguredAudioCaptureDevices();
+        }
     }
 }
-- 
GitLab