Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 22nd, 2012  |  syntax: None  |  size: 1.80 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.  xbmc/cores/ExternalPlayer/ExternalPlayer.cpp |   24 ++++++++++++++++++++++++
  2.  1 files changed, 24 insertions(+), 0 deletions(-)
  3.  
  4. diff --git a/xbmc/cores/ExternalPlayer/ExternalPlayer.cpp b/xbmc/cores/ExternalPlayer/ExternalPlayer.cpp
  5. index 766b061..f8c8bf3 100644
  6. --- a/xbmc/cores/ExternalPlayer/ExternalPlayer.cpp
  7. +++ b/xbmc/cores/ExternalPlayer/ExternalPlayer.cpp
  8. @@ -39,6 +39,9 @@
  9.  #include "utils/log.h"
  10.  #if defined(_WIN32)
  11.    #include "Windows.h"
  12. +  #include "cores/AudioEngine/AEFactory.h"
  13. +  #include "settings/Settings.h"
  14. +  #include "Application.h"
  15.    #ifdef HAS_IRSERVERSUITE
  16.      #include "input/windows/IRServerSuite.h"
  17.    #endif
  18. @@ -376,6 +379,8 @@ BOOL CExternalPlayer::ExecuteAppW32(const char* strPath, const char* strSwitches
  19.  
  20.    if (m_bAbortRequest) return false;
  21.  
  22. +  CAEFactory::UnLoadEngine();
  23. +
  24.    BOOL ret = CreateProcessW(WstrPath.IsEmpty() ? NULL : WstrPath.c_str(),
  25.                              (LPWSTR) WstrSwitches.c_str(), NULL, NULL, FALSE, NULL,
  26.                              NULL, NULL, &si, &m_processInfo);
  27. @@ -412,6 +417,25 @@ BOOL CExternalPlayer::ExecuteAppW32(const char* strPath, const char* strSwitches
  28.      m_processInfo.hProcess = 0;
  29.    }
  30.  
  31. +  /* Re-load the AudioEngine */
  32. +  if (!CAEFactory::LoadEngine())
  33. +  {
  34. +    CLog::Log(LOGFATAL, "CApplication::Create: Failed to load an AudioEngine");
  35. +    return false;
  36. +  }
  37. +
  38. +  /* Start the AudioEngine */
  39. +  if (!CAEFactory::StartEngine())
  40. +  {
  41. +    CLog::Log(LOGFATAL, "CApplication::Create: Failed to start the AudioEngine");
  42. +    return false;
  43. +  }
  44. +
  45. +  /* Restore previous sound state */
  46. +  CAEFactory::SetVolume   (g_settings.m_fVolumeLevel);
  47. +  CAEFactory::SetMute     (g_settings.m_bMute);
  48. +  CAEFactory::SetSoundMode(g_guiSettings.GetInt("audiooutput.guisoundmode"));
  49. +
  50.    return ret;
  51.  }
  52.  #endif