changed: enable zeroconf if airplay is being enabled. disable airplay if zeroconf...
authorWiSo <wiso@xbmc.org>
Mon, 10 Oct 2011 17:51:31 +0000 (19:51 +0200)
committerWiSo <wiso@xbmc.org>
Tue, 11 Oct 2011 07:39:26 +0000 (09:39 +0200)
xbmc/settings/GUIWindowSettingsCategory.cpp

index b9e3495..358537d 100644 (file)
@@ -1291,16 +1291,37 @@ void CGUIWindowSettingsCategory::OnSettingChanged(CBaseSettingControl *pSettingC
   {
 #ifdef HAS_ZEROCONF
     //ifdef zeroconf here because it's only found in guisettings if defined
-    CZeroconf::GetInstance()->Stop();
     if(g_guiSettings.GetBool("services.zeroconf"))
+    {
+      CZeroconf::GetInstance()->Stop();
       CZeroconf::GetInstance()->Start();
+    }
+#ifdef HAS_AIRPLAY
+    else
+    {
+      g_application.StopAirplayServer(true);
+      g_guiSettings.SetBool("services.airplay", false);
+      CZeroconf::GetInstance()->Stop();
+    }
+#endif
 #endif
   }
   else if (strSetting.Equals("services.airplay"))
   {  
 #ifdef HAS_AIRPLAY  
     if (g_guiSettings.GetBool("services.airplay"))
+    {
+#ifdef HAS_ZEROCONF
+      // AirPlay needs zeroconf
+      if(!g_guiSettings.GetBool("services.zeroconf"))
+      {
+        g_guiSettings.SetBool("services.zeroconf", true);
+        CZeroconf::GetInstance()->Stop();
+        CZeroconf::GetInstance()->Start();
+      }
+#endif //HAS_ZEROCONF
       g_application.StartAirplayServer();//will stop the server before internal
+    }
     else
       g_application.StopAirplayServer(true);//will stop the server before internal    
 #endif//HAS_AIRPLAY