summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2025-09-17 21:48:09 +0300
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2025-09-18 19:30:57 +0300
commit1cda0a1a450853671e9961de67aea065f0a260ea (patch)
tree901202d1ab56751da15d6ab198fc6f9160bfa7fc
parent42b09b236bae797303af94fc003466ca649259a2 (diff)
#4687 Fix audio device selection showing a bunch of zeros
-rw-r--r--indra/newview/llpanelvoicedevicesettings.cpp29
-rw-r--r--indra/newview/skins/default/xui/en/panel_sound_devices.xml4
2 files changed, 31 insertions, 2 deletions
diff --git a/indra/newview/llpanelvoicedevicesettings.cpp b/indra/newview/llpanelvoicedevicesettings.cpp
index 60877494e7..d8d6bcf5fd 100644
--- a/indra/newview/llpanelvoicedevicesettings.cpp
+++ b/indra/newview/llpanelvoicedevicesettings.cpp
@@ -240,13 +240,38 @@ void LLPanelVoiceDeviceSettings::refresh()
if(mCtrlInputDevices)
{
mCtrlInputDevices->removeall();
- mCtrlInputDevices->add(getLocalizedDeviceName(mInputDevice), mInputDevice, ADD_BOTTOM);
+ auto it = mLocalizedDeviceNames.find(mInputDevice);
+ if (it != mLocalizedDeviceNames.end())
+ {
+ mCtrlInputDevices->add(getLocalizedDeviceName(mInputDevice), mInputDevice, ADD_BOTTOM);
+ }
+ else
+ {
+ // Display name generaly doesn't match value.
+ // Value is an id so it's not nessesary readable,
+ // might not even be valid (disconnected usb).
+ // Until we get the data, don't change the device,
+ // otherwise box might override the control.
+ // But show a readable placeholder.
+ // Combo is disabled so it's safe to show
+ // a placeholder.
+ mCtrlInputDevices->add(getString("device_not_loaded"), mInputDevice, ADD_BOTTOM);
+ }
mCtrlInputDevices->setValue(mInputDevice);
}
if(mCtrlOutputDevices)
{
mCtrlOutputDevices->removeall();
- mCtrlOutputDevices->add(getLocalizedDeviceName(mOutputDevice), mOutputDevice, ADD_BOTTOM);
+ auto it = mLocalizedDeviceNames.find(mOutputDevice);
+ if (it != mLocalizedDeviceNames.end())
+ {
+ mCtrlOutputDevices->add(getLocalizedDeviceName(mOutputDevice), mOutputDevice, ADD_BOTTOM);
+ }
+ else
+ {
+ // Don't change the device, only the label
+ mCtrlOutputDevices->add(getString("device_not_loaded"), mOutputDevice, ADD_BOTTOM);
+ }
mCtrlOutputDevices->setValue(mOutputDevice);
}
}
diff --git a/indra/newview/skins/default/xui/en/panel_sound_devices.xml b/indra/newview/skins/default/xui/en/panel_sound_devices.xml
index 7598f7d7e5..b858d0ed02 100644
--- a/indra/newview/skins/default/xui/en/panel_sound_devices.xml
+++ b/indra/newview/skins/default/xui/en/panel_sound_devices.xml
@@ -20,6 +20,10 @@
name="name_default_system_device">
Default System Device
</string>
+ <string
+ name="device_not_loaded">
+ Device not loaded
+ </string>
<icon
follows="left|top"
height="18"