Merge remote-tracking branch 'check/next-cc'

...only build-tested, needs fixes


Origin commit data
------------------
Commit: ecd62d81d1
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2014-02-15 (Sat, 15 Feb 2014)
This commit is contained in:
Stefan Seyfried
2014-02-15 20:22:07 +01:00
77 changed files with 1056 additions and 396 deletions

View File

@@ -2327,6 +2327,24 @@ void CEitManager::getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEve
unlockEvents();
}
/* invalidate current/next events, if current event times expired */
void CEitManager::checkCurrentNextEvent(void)
{
time_t curtime = time(NULL);
writeLockEvents();
if (scanning || !myCurrentEvent || myCurrentEvent->times.empty()) {
unlockEvents();
return;
}
if ((long)(myCurrentEvent->times.begin()->startzeit + myCurrentEvent->times.begin()->dauer) < (long)curtime) {
delete myCurrentEvent;
myCurrentEvent = NULL;
delete myNextEvent;
myNextEvent = NULL;
}
unlockEvents();
}
/* send back the current and next event for the channel id passed to it
* Works like that:
* - if the currently running program is requested, return myCurrentEvent and myNextEvent,
@@ -2350,6 +2368,8 @@ void CEitManager::getCurrentNextServiceKey(t_channel_id uniqueServiceKey, CSecti
uniqueServiceKey &= 0xFFFFFFFFFFFFULL;
checkCurrentNextEvent();
readLockEvents();
/* if the currently running program is requested... */
if (uniqueServiceKey == messaging_current_servicekey) {
@@ -2608,6 +2628,7 @@ bool CEitManager::getActualEPGServiceKey(const t_channel_id channel_id, CEPGData
dprintf("[commandActualEPGchannelID] Request of current EPG for " PRINTF_CHANNEL_ID_TYPE "\n", channel_id);
t_channel_id uniqueServiceKey = channel_id & 0xFFFFFFFFFFFFULL;
checkCurrentNextEvent();
readLockEvents();
if (uniqueServiceKey == messaging_current_servicekey) {
if (myCurrentEvent) {