Permalink
Browse files

[power] hack - don't kill lirc or cec

  • Loading branch information...
popcornmix committed Mar 3, 2014
1 parent 0619851 commit 0c369603e618ac3a0205c293d93f4940d06a5d75
Showing with 39 additions and 2 deletions.
  1. +37 −0 xbmc/peripherals/devices/PeripheralCecAdapter.cpp
  2. +2 −2 xbmc/powermanagement/PowerManager.cpp
@@ -194,12 +194,49 @@ void CPeripheralCecAdapter::Announce(AnnouncementFlag flag, const char *sender,
}
else if (flag == System && !strcmp(sender, "xbmc") && !strcmp(message, "OnSleep"))
{
#if 1
bool bSendStandbyCommands(false);
{
CSingleLock lock(m_critSection);
bSendStandbyCommands = m_iExitCode != EXITCODE_REBOOT &&
m_iExitCode != EXITCODE_RESTARTAPP &&
!m_bDeviceRemoved &&
(!m_bGoingToStandby || GetSettingBool("standby_tv_on_pc_standby")) &&
GetSettingBool("enabled");
if (m_bGoingToStandby)
m_bActiveSourceBeforeStandby = m_cecAdapter->IsLibCECActiveSource();
}
if (bSendStandbyCommands)
{
if (m_cecAdapter->IsLibCECActiveSource())
{
if (!m_configuration.powerOffDevices.IsEmpty())
{
CLog::Log(LOGDEBUG, "%s - sending standby commands", __FUNCTION__);
m_standbySent = CDateTime::GetCurrentDateTime();
m_cecAdapter->StandbyDevices();
}
else if (m_bSendInactiveSource)
{
CLog::Log(LOGDEBUG, "%s - sending inactive source commands", __FUNCTION__);
m_cecAdapter->SetInactiveView();
}
}
else
{
CLog::Log(LOGDEBUG, "%s - XBMC is not the active source, not sending any standby commands", __FUNCTION__);
}
}
#else
// this will also power off devices when we're the active source
{
CSingleLock lock(m_critSection);
m_bGoingToStandby = true;
}
StopThread();
#endif
}
else if (flag == System && !strcmp(sender, "xbmc") && !strcmp(message, "OnWake"))
{
@@ -261,7 +261,7 @@ void CPowerManager::OnSleep()
CLog::Log(LOGNOTICE, "%s: Running sleep jobs", __FUNCTION__);
// stop lirc
#if defined(HAS_LIRC) || defined(HAS_IRSERVERSUITE)
#if 0 //defined(HAS_LIRC) || defined(HAS_IRSERVERSUITE)
CLog::Log(LOGNOTICE, "%s: Stopping lirc", __FUNCTION__);
CBuiltins::GetInstance().Execute("LIRC.Stop");
#endif
@@ -300,7 +300,7 @@ void CPowerManager::OnWake()
#endif
// restart lirc
#if defined(HAS_LIRC) || defined(HAS_IRSERVERSUITE)
#if 0 // defined(HAS_LIRC) || defined(HAS_IRSERVERSUITE)
CLog::Log(LOGNOTICE, "%s: Restarting lirc", __FUNCTION__);
CBuiltins::GetInstance().Execute("LIRC.Start");
#endif

0 comments on commit 0c36960

Please sign in to comment.