Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

AEFactory: Adjust Factory and SinkFactory after AESinkPULSE

  • Loading branch information...
commit ea5ca1efe2485945c621c04ef395c43b99261264 1 parent 366ae3b
@fritsch fritsch authored fritsch committed
View
36 xbmc/cores/AudioEngine/AEFactory.cpp
@@ -29,10 +29,6 @@
#include "Engines/ActiveAE/ActiveAE.h"
#endif
-#if defined(HAS_PULSEAUDIO)
- #include "Engines/PulseAE/PulseAE.h"
-#endif
-
#include "guilib/LocalizeStrings.h"
#include "settings/lib/Setting.h"
#include "settings/Settings.h"
@@ -49,36 +45,11 @@ IAE *CAEFactory::GetEngine()
bool CAEFactory::LoadEngine()
{
- bool loaded = false;
-
#if defined(TARGET_DARWIN)
return CAEFactory::LoadEngine(AE_ENGINE_COREAUDIO);
+#else
+ return CAEFactory::LoadEngine(AE_ENGINE_ACTIVE);
#endif
-
- std::string engine;
- if (getenv("AE_ENGINE"))
- {
- engine = (std::string)getenv("AE_ENGINE");
- std::transform(engine.begin(), engine.end(), engine.begin(), ::toupper);
-
- #if defined(HAS_PULSEAUDIO)
- if (!loaded && engine == "PULSE")
- loaded = CAEFactory::LoadEngine(AE_ENGINE_PULSE);
- #endif
-
- if (!loaded && engine == "ACTIVE")
- loaded = CAEFactory::LoadEngine(AE_ENGINE_ACTIVE);
- }
-
-#if defined(HAS_PULSEAUDIO)
- if (!loaded)
- loaded = CAEFactory::LoadEngine(AE_ENGINE_PULSE);
-#endif
-
- if (!loaded)
- loaded = CAEFactory::LoadEngine(AE_ENGINE_ACTIVE);
-
- return loaded;
}
bool CAEFactory::LoadEngine(enum AEEngine engine)
@@ -95,9 +66,6 @@ bool CAEFactory::LoadEngine(enum AEEngine engine)
#else
case AE_ENGINE_ACTIVE : AE = new ActiveAE::CActiveAE(); break;
#endif
-#if defined(HAS_PULSEAUDIO)
- case AE_ENGINE_PULSE : AE = new CPulseAE(); break;
-#endif
default:
return false;
}
View
1  xbmc/cores/AudioEngine/AEFactory.h
@@ -30,7 +30,6 @@ enum AEEngine
{
AE_ENGINE_NULL,
AE_ENGINE_COREAUDIO,
- AE_ENGINE_PULSE,
AE_ENGINE_ACTIVE,
AE_ENGINE_PIAUDIO
};
View
19 xbmc/cores/AudioEngine/AESinkFactory.cpp
@@ -31,6 +31,9 @@
#if defined(HAS_ALSA)
#include "Sinks/AESinkALSA.h"
#endif
+ #if defined(HAS_PULSEAUDIO)
+ #include "Sinks/AESinkPULSE.h"
+ #endif
#include "Sinks/AESinkOSS.h"
#else
#pragma message("NOTICE: No audio sink for target platform. Audio output will not be available.")
@@ -63,6 +66,9 @@ void CAESinkFactory::ParseDevice(std::string &device, std::string &driver)
#if defined(HAS_ALSA)
driver == "ALSA" ||
#endif
+ #if defined(HAS_PULSEAUDIO)
+ driver == "PULSE" ||
+ #endif
driver == "OSS" ||
#endif
driver == "PROFILER")
@@ -119,6 +125,11 @@ IAESink *CAESinkFactory::Create(std::string &device, AEAudioFormat &desiredForma
TRY_SINK(Pi)
#elif defined(TARGET_LINUX) || defined(TARGET_FREEBSD)
+ #if defined(HAS_PULSEAUDIO)
+ if (driver.empty() || driver == "PULSE")
+ TRY_SINK(PULSE)
+ #endif
+
#if defined(HAS_ALSA)
if (driver.empty() || driver == "ALSA")
TRY_SINK(ALSA)
@@ -154,6 +165,14 @@ void CAESinkFactory::EnumerateEx(AESinkInfoList &list, bool force)
#elif defined(TARGET_RASPBERRY_PI)
ENUMERATE_SINK(Pi, force);
#elif defined(TARGET_LINUX) || defined(TARGET_FREEBSD)
+ #if defined(HAS_PULSEAUDIO)
+ ENUMERATE_SINK(PULSE, force);
+ #endif
+
+ if (!list.empty()) {
+ return;
+ }
+
#if defined(HAS_ALSA)
ENUMERATE_SINK(ALSA, force);
#endif
View
4 xbmc/cores/AudioEngine/Makefile.in
@@ -54,9 +54,7 @@ else
SRCS += Sinks/AESinkALSA.cpp
SRCS += Sinks/AESinkOSS.cpp
ifeq (@USE_PULSE@,1)
-SRCS += Engines/PulseAE/PulseAE.cpp
-SRCS += Engines/PulseAE/PulseAEStream.cpp
-SRCS += Engines/PulseAE/PulseAESound.cpp
+SRCS += Sinks/AESinkPULSE.cpp
endif
endif
endif
Please sign in to comment.
Something went wrong with that request. Please try again.