CGUIWindowSettingsCategory: don't allow to choose a non-existing audio device
authormontellese <montellese@xbmc.org>
Wed, 21 Nov 2012 23:40:12 +0000 (00:40 +0100)
committermontellese <montellese@xbmc.org>
Thu, 22 Nov 2012 07:33:30 +0000 (08:33 +0100)
xbmc/settings/GUIWindowSettingsCategory.cpp

index 174615d..1f83cc9 100644 (file)
@@ -2910,8 +2910,11 @@ void CGUIWindowSettingsCategory::FillInAudioDevices(CSetting* pSetting, bool Pas
   if (selectedValue < 0)
   {
     CLog::Log(LOGWARNING, "Failed to find previously selected audio sink");
-    pControl->AddLabel(currentDevice, numberSinks);
-    pControl->SetValue(numberSinks);
+    pControl->SetValue(0);
+    if (!Passthrough)
+      ((CSettingString*)pSetting)->SetData(m_AnalogAudioSinkMap[pControl->GetCurrentLabel()]);
+    else
+      ((CSettingString*)pSetting)->SetData(m_DigitalAudioSinkMap[pControl->GetCurrentLabel()]);
   }
   else
     pControl->SetValue(selectedValue);