From 5f69a34e907018108767e4b738e52ffe9c76b674 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Mon, 24 Sep 2018 10:46:28 +0200 Subject: [PVR] Fix CPVRItem::GetNextEpgInfoTag to use the more flexible method, which handles epg gaps correctly. --- xbmc/pvr/PVRItem.cpp | 10 ++++++---- xbmc/pvr/epg/Epg.cpp | 11 ----------- xbmc/pvr/epg/Epg.h | 2 -- xbmc/pvr/epg/EpgInfoTag.cpp | 5 ----- xbmc/pvr/epg/EpgInfoTag.h | 6 ------ 5 files changed, 6 insertions(+), 28 deletions(-) diff --git a/xbmc/pvr/PVRItem.cpp b/xbmc/pvr/PVRItem.cpp index 272a10c3b1..d9667d2477 100644 --- a/xbmc/pvr/PVRItem.cpp +++ b/xbmc/pvr/PVRItem.cpp @@ -46,7 +46,9 @@ namespace PVR { if (m_item->IsEPG()) { - return m_item->GetEPGInfoTag()->GetNextEvent(); + const CPVRChannelPtr channel = m_item->GetEPGInfoTag()->Channel(); + if (channel) + return channel->GetEPGNext(); } else if (m_item->IsPVRChannel()) { @@ -54,9 +56,9 @@ namespace PVR } else if (m_item->IsPVRTimer()) { - const CPVREpgInfoTagPtr current = m_item->GetPVRTimerInfoTag()->GetEpgInfoTag(); - if (current) - return current->GetNextEvent(); + const CPVRChannelPtr channel =m_item->GetPVRTimerInfoTag()->Channel(); + if (channel) + return channel->GetEPGNext(); } else { diff --git a/xbmc/pvr/epg/Epg.cpp b/xbmc/pvr/epg/Epg.cpp index 2cc28f0537..dd47dfc50a 100644 --- a/xbmc/pvr/epg/Epg.cpp +++ b/xbmc/pvr/epg/Epg.cpp @@ -843,17 +843,6 @@ bool CPVREpg::LoadFromClients(time_t start, time_t end, bool bForceUpdate) return bReturn; } -CPVREpgInfoTagPtr CPVREpg::GetNextEvent(const CPVREpgInfoTag& tag) const -{ - CSingleLock lock(m_critSection); - std::map::const_iterator it = m_tags.find(tag.StartAsUTC()); - if (it != m_tags.end() && ++it != m_tags.end()) - return it->second; - - CPVREpgInfoTagPtr retVal; - return retVal; -} - CPVRChannelPtr CPVREpg::Channel(void) const { CSingleLock lock(m_critSection); diff --git a/xbmc/pvr/epg/Epg.h b/xbmc/pvr/epg/Epg.h index 8dd62b92ce..9f5bb31509 100644 --- a/xbmc/pvr/epg/Epg.h +++ b/xbmc/pvr/epg/Epg.h @@ -268,8 +268,6 @@ namespace PVR */ static const std::string &ConvertGenreIdToString(int iID, int iSubID); - CPVREpgInfoTagPtr GetNextEvent(const CPVREpgInfoTag& tag) const; - size_t Size(void) const; bool NeedsSave(void) const; diff --git a/xbmc/pvr/epg/EpgInfoTag.cpp b/xbmc/pvr/epg/EpgInfoTag.cpp index 510278eea9..8cf4a0606f 100644 --- a/xbmc/pvr/epg/EpgInfoTag.cpp +++ b/xbmc/pvr/epg/EpgInfoTag.cpp @@ -272,11 +272,6 @@ int CPVREpgInfoTag::Progress(void) const return iDuration; } -CPVREpgInfoTagPtr CPVREpgInfoTag::GetNextEvent(void) const -{ - return GetTable()->GetNextEvent(*this); -} - void CPVREpgInfoTag::SetUniqueBroadcastID(unsigned int iUniqueBroadcastID) { m_iUniqueBroadcastID = iUniqueBroadcastID; diff --git a/xbmc/pvr/epg/EpgInfoTag.h b/xbmc/pvr/epg/EpgInfoTag.h index 56242597f5..eb3dac4f00 100644 --- a/xbmc/pvr/epg/EpgInfoTag.h +++ b/xbmc/pvr/epg/EpgInfoTag.h @@ -100,12 +100,6 @@ namespace PVR */ int Progress(void) const; - /*! - * @brief Get a pointer to the next event. - * @return A pointer to the next event or NULL if it's not set. - */ - CPVREpgInfoTagPtr GetNextEvent(void) const; - /*! * @brief The table this event belongs to * @return The table this event belongs to -- cgit v1.2.3