Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #4070 from vkosh/epg-now

[epg] don't use epg tag that was active as a currently active one if epg contains gaps
  • Loading branch information...
commit 5d6b85219b880d372aca95396a382ef6186e9881 2 parents 1d9b670 + 88ea69c
@opdenkamp opdenkamp authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 xbmc/epg/Epg.cpp
View
12 xbmc/epg/Epg.cpp
@@ -198,7 +198,7 @@ bool CEpg::InfoTagNow(CEpgInfoTag &tag, bool bUpdateIfNeeded /* = true */)
if (bUpdateIfNeeded)
{
- CDateTime lastActiveTag;
+ CEpgInfoTagPtr lastActiveTag;
/* one of the first items will always match if the list is sorted */
for (map<CDateTime, CEpgInfoTagPtr>::const_iterator it = m_tags.begin(); it != m_tags.end(); it++)
@@ -210,14 +210,14 @@ bool CEpg::InfoTagNow(CEpgInfoTag &tag, bool bUpdateIfNeeded /* = true */)
return true;
}
else if (it->second->WasActive())
- lastActiveTag = it->first;
+ lastActiveTag = it->second;
}
- /* there might be a gap between the last and next event. just return the last if found */
- map<CDateTime, CEpgInfoTagPtr>::const_iterator it = m_tags.find(lastActiveTag);
- if (it != m_tags.end())
+ /* there might be a gap between the last and next event. return the last if found and it ended not more than 5 minutes ago */
+ if (lastActiveTag &&
+ lastActiveTag->EndAsUTC() + CDateTimeSpan(0, 0, 5, 0) >= CDateTime::GetUTCDateTime())
{
- tag = *it->second;
+ tag = *lastActiveTag;
return true;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.