Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

PVRTimers: Prevent use of uninitialised dailywakeuptime

  • Loading branch information...
commit 5ab27e355aaed6648ab9acc0aa88a236a848ae97 1 parent d53fe62
@mikrohard mikrohard authored committed
Showing with 7 additions and 5 deletions.
  1. +7 −5 xbmc/pvr/timers/PVRTimers.cpp
View
12 xbmc/pvr/timers/PVRTimers.cpp
@@ -714,8 +714,7 @@ CDateTime CPVRTimers::GetNextEventTime(void) const
const CDateTimeSpan prewakeup(0, 0, g_guiSettings.GetInt("pvrpowermanagement.prewakeup"), 0);
const CDateTimeSpan idle(0, 0, g_guiSettings.GetInt("pvrpowermanagement.backendidletime"), 0);
- CDateTime timerwakeuptime;
- CDateTime dailywakeuptime;
+ CDateTime wakeuptime;
/* Check next active time */
CPVRTimerInfoTag timer;
@@ -724,15 +723,16 @@ CDateTime CPVRTimers::GetNextEventTime(void) const
const CDateTime start = timer.StartAsUTC();
if ((start - idle) > now) {
- timerwakeuptime = start - prewakeup;
+ wakeuptime = start - prewakeup;
} else {
- timerwakeuptime = now + idle;
+ wakeuptime = now + idle;
}
}
/* check daily wake up */
if (dailywakup)
{
+ CDateTime dailywakeuptime;
dailywakeuptime.SetFromDBTime(g_guiSettings.GetString("pvrpowermanagement.dailywakeuptime", false));
dailywakeuptime = dailywakeuptime.GetAsUTCDateTime();
@@ -746,8 +746,10 @@ CDateTime CPVRTimers::GetNextEventTime(void) const
const CDateTimeSpan oneDay(1,0,0,0);
dailywakeuptime += oneDay;
}
+ if (dailywakeuptime < wakeuptime)
+ wakeuptime = dailywakeuptime;
}
- const CDateTime retVal((dailywakeuptime < timerwakeuptime) ? dailywakeuptime : timerwakeuptime);
+ const CDateTime retVal(wakeuptime);
return retVal;
}
Please sign in to comment.
Something went wrong with that request. Please try again.