Skip to content
This repository
Browse code

Refactor AE engine selection.

  • Loading branch information...
commit 8abcd38442a3734ec83e04e0a72bcc3adc577d14 1 parent f116101
Trent Nelson authored September 11, 2013

Showing 1 changed file with 5 additions and 22 deletions. Show diff stats Hide diff stats

  1. 27  xbmc/cores/AudioEngine/AEFactory.cpp
27  xbmc/cores/AudioEngine/AEFactory.cpp
@@ -49,13 +49,14 @@ IAE *CAEFactory::GetEngine()
49 49
 
50 50
 bool CAEFactory::LoadEngine()
51 51
 {
  52
+  bool loaded = false;
  53
+
52 54
 #if defined(TARGET_RASPBERRY_PI)
53 55
   return true;
  56
+#elif defined(TARGET_DARWIN)
  57
+  return CAEFactory::LoadEngine(AE_ENGINE_COREAUDIO);
54 58
 #endif
55 59
 
56  
-  bool loaded = false;
57  
-
58  
-#if defined(TARGET_LINUX) || defined(TARGET_FREEBSD)
59 60
   std::string engine;
60 61
   if (getenv("AE_ENGINE"))
61 62
   {
@@ -66,39 +67,21 @@ bool CAEFactory::LoadEngine()
66 67
     if (!loaded && engine == "PULSE")
67 68
       loaded = CAEFactory::LoadEngine(AE_ENGINE_PULSE);
68 69
     #endif
  70
+    
69 71
     if (!loaded && engine == "SOFT" )
70 72
       loaded = CAEFactory::LoadEngine(AE_ENGINE_SOFT);
71  
-    if (!loaded && engine == "ACTIVE")
72  
-      loaded = CAEFactory::LoadEngine(AE_ENGINE_ACTIVE);
73  
-  }
74  
-#endif
75 73
 
76  
-#if defined(TARGET_WINDOWS)
77  
-  std::string engine;
78  
-  if (getenv("AE_ENGINE"))
79  
-  {
80  
-    engine = (std::string)getenv("AE_ENGINE");
81  
-    std::transform(engine.begin(), engine.end(), engine.begin(), ::toupper);
82  
-
83  
-    if (!loaded && engine == "SOFT" )
84  
-      loaded = CAEFactory::LoadEngine(AE_ENGINE_SOFT);
85 74
     if (!loaded && engine == "ACTIVE")
86 75
       loaded = CAEFactory::LoadEngine(AE_ENGINE_ACTIVE);
87 76
   }
88  
-#endif
89 77
 
90 78
 #if defined(HAS_PULSEAUDIO)
91 79
   if (!loaded)
92 80
     loaded = CAEFactory::LoadEngine(AE_ENGINE_PULSE);
93 81
 #endif
94 82
 
95  
-#if defined(TARGET_DARWIN)
96  
-  if (!loaded)
97  
-    loaded = CAEFactory::LoadEngine(AE_ENGINE_COREAUDIO);
98  
-#else
99 83
   if (!loaded)
100 84
     loaded = CAEFactory::LoadEngine(AE_ENGINE_ACTIVE);
101  
-#endif
102 85
 
103 86
   return loaded;
104 87
 }

0 notes on commit 8abcd38

Please sign in to comment.
Something went wrong with that request. Please try again.