Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #1847 from mikrohard/pvr-wakeup

Only use valid CDateTime objects for pvr wakeup command
  • Loading branch information...
commit 2d81d77660a0bebddb20d6a632cc2c909a7c07a4 2 parents f528cd3 + 1090ed4
@opdenkamp opdenkamp authored
Showing with 14 additions and 11 deletions.
  1. +13 −10 xbmc/pvr/PVRManager.cpp
  2. +1 −1  xbmc/pvr/timers/PVRTimers.cpp
View
23 xbmc/pvr/PVRManager.cpp
@@ -275,16 +275,19 @@ bool CPVRManager::SetWakeupCommand(void)
{
time_t iWakeupTime;
const CDateTime nextEvent = m_timers->GetNextEventTime();
- nextEvent.GetAsTime(iWakeupTime);
-
- CStdString strExecCommand;
- strExecCommand.Format("%s %d", strWakeupCommand, iWakeupTime);
-
- const int iReturn = system(strExecCommand.c_str());
- if (iReturn != 0)
- CLog::Log(LOGERROR, "%s - failed to execute wakeup command '%s': %s (%d)", __FUNCTION__, strExecCommand.c_str(), strerror(iReturn), iReturn);
-
- return iReturn == 0;
+ if (nextEvent.IsValid())
+ {
+ nextEvent.GetAsTime(iWakeupTime);
+
+ CStdString strExecCommand;
+ strExecCommand.Format("%s %d", strWakeupCommand, iWakeupTime);
+
+ const int iReturn = system(strExecCommand.c_str());
+ if (iReturn != 0)
+ CLog::Log(LOGERROR, "%s - failed to execute wakeup command '%s': %s (%d)", __FUNCTION__, strExecCommand.c_str(), strerror(iReturn), iReturn);
+
+ return iReturn == 0;
+ }
}
return false;
View
2  xbmc/pvr/timers/PVRTimers.cpp
@@ -685,7 +685,7 @@ CDateTime CPVRTimers::GetNextEventTime(void) const
const CDateTimeSpan oneDay(1,0,0,0);
dailywakeuptime += oneDay;
}
- if (dailywakeuptime < wakeuptime)
+ if (!wakeuptime.IsValid() || dailywakeuptime < wakeuptime)
wakeuptime = dailywakeuptime;
}
Please sign in to comment.
Something went wrong with that request. Please try again.