
Untitled
By: a guest on
Aug 22nd, 2012 | syntax:
None | size: 1.80 KB | hits: 11 | expires: Never
xbmc/cores/ExternalPlayer/ExternalPlayer.cpp | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/xbmc/cores/ExternalPlayer/ExternalPlayer.cpp b/xbmc/cores/ExternalPlayer/ExternalPlayer.cpp
index 766b061..f8c8bf3 100644
--- a/xbmc/cores/ExternalPlayer/ExternalPlayer.cpp
+++ b/xbmc/cores/ExternalPlayer/ExternalPlayer.cpp
@@ -39,6 +39,9 @@
#include "utils/log.h"
#if defined(_WIN32)
#include "Windows.h"
+ #include "cores/AudioEngine/AEFactory.h"
+ #include "settings/Settings.h"
+ #include "Application.h"
#ifdef HAS_IRSERVERSUITE
#include "input/windows/IRServerSuite.h"
#endif
@@ -376,6 +379,8 @@ BOOL CExternalPlayer::ExecuteAppW32(const char* strPath, const char* strSwitches
if (m_bAbortRequest) return false;
+ CAEFactory::UnLoadEngine();
+
BOOL ret = CreateProcessW(WstrPath.IsEmpty() ? NULL : WstrPath.c_str(),
(LPWSTR) WstrSwitches.c_str(), NULL, NULL, FALSE, NULL,
NULL, NULL, &si, &m_processInfo);
@@ -412,6 +417,25 @@ BOOL CExternalPlayer::ExecuteAppW32(const char* strPath, const char* strSwitches
m_processInfo.hProcess = 0;
}
+ /* Re-load the AudioEngine */
+ if (!CAEFactory::LoadEngine())
+ {
+ CLog::Log(LOGFATAL, "CApplication::Create: Failed to load an AudioEngine");
+ return false;
+ }
+
+ /* Start the AudioEngine */
+ if (!CAEFactory::StartEngine())
+ {
+ CLog::Log(LOGFATAL, "CApplication::Create: Failed to start the AudioEngine");
+ return false;
+ }
+
+ /* Restore previous sound state */
+ CAEFactory::SetVolume (g_settings.m_fVolumeLevel);
+ CAEFactory::SetMute (g_settings.m_bMute);
+ CAEFactory::SetSoundMode(g_guiSettings.GetInt("audiooutput.guisoundmode"));
+
return ret;
}
#endif