Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Only use valid CDateTime objects for pvr wakeup command #1847

Merged
merged 1 commit into from

3 participants

@mikrohard

This commit fixes the problem where daily wakeup never happens if there are no recordings scheduled (the daily wakeup time is compared with an invalid time object). The problem is also described in the forums: http://forum.xbmc.org/showthread.php?tid=145674

I also added a validation check for the datetime object before calling the wakeup script.

@jmarshallnz
Owner

@opdenkamp looks fine to me.

@opdenkamp opdenkamp merged commit 2d81d77 into xbmc:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 25, 2012
This page is out of date. Refresh to see the latest.
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;
}
Something went wrong with that request. Please try again.