Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Refactor AE engine selection.

  • Loading branch information...
commit 8abcd38442a3734ec83e04e0a72bcc3adc577d14 1 parent f116101
Trent Nelson authored
Showing with 5 additions and 22 deletions.
  1. +5 −22 xbmc/cores/AudioEngine/AEFactory.cpp
View
27 xbmc/cores/AudioEngine/AEFactory.cpp
@@ -49,13 +49,14 @@ IAE *CAEFactory::GetEngine()
bool CAEFactory::LoadEngine()
{
+ bool loaded = false;
+
#if defined(TARGET_RASPBERRY_PI)
return true;
+#elif defined(TARGET_DARWIN)
+ return CAEFactory::LoadEngine(AE_ENGINE_COREAUDIO);
#endif
- bool loaded = false;
-
-#if defined(TARGET_LINUX) || defined(TARGET_FREEBSD)
std::string engine;
if (getenv("AE_ENGINE"))
{
@@ -66,39 +67,21 @@ bool CAEFactory::LoadEngine()
if (!loaded && engine == "PULSE")
loaded = CAEFactory::LoadEngine(AE_ENGINE_PULSE);
#endif
+
if (!loaded && engine == "SOFT" )
loaded = CAEFactory::LoadEngine(AE_ENGINE_SOFT);
- if (!loaded && engine == "ACTIVE")
- loaded = CAEFactory::LoadEngine(AE_ENGINE_ACTIVE);
- }
-#endif
-#if defined(TARGET_WINDOWS)
- std::string engine;
- if (getenv("AE_ENGINE"))
- {
- engine = (std::string)getenv("AE_ENGINE");
- std::transform(engine.begin(), engine.end(), engine.begin(), ::toupper);
-
- if (!loaded && engine == "SOFT" )
- loaded = CAEFactory::LoadEngine(AE_ENGINE_SOFT);
if (!loaded && engine == "ACTIVE")
loaded = CAEFactory::LoadEngine(AE_ENGINE_ACTIVE);
}
-#endif
#if defined(HAS_PULSEAUDIO)
if (!loaded)
loaded = CAEFactory::LoadEngine(AE_ENGINE_PULSE);
#endif
-#if defined(TARGET_DARWIN)
- if (!loaded)
- loaded = CAEFactory::LoadEngine(AE_ENGINE_COREAUDIO);
-#else
if (!loaded)
loaded = CAEFactory::LoadEngine(AE_ENGINE_ACTIVE);
-#endif
return loaded;
}
Please sign in to comment.
Something went wrong with that request. Please try again.