From: jmarshallnz Date: Tue, 20 May 2014 19:42:54 +0000 (+1200) Subject: Merge pull request #4751 from fritsch/pvr-fix X-Git-Tag: 13.2b1-Gotham~32^2~21 X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_xbmc;a=commitdiff_plain;h=a2b01a5f320ac6098906c9fe63146961656f13fb;ds=sidebyside Merge pull request #4751 from fritsch/pvr-fix EpgContainer: Fix Deadlock when calling Observer with lock --- diff --git a/xbmc/epg/EpgContainer.cpp b/xbmc/epg/EpgContainer.cpp index 68d23c9..d2bc48f 100644 --- a/xbmc/epg/EpgContainer.cpp +++ b/xbmc/epg/EpgContainer.cpp @@ -670,32 +670,31 @@ bool CEpgContainer::CheckPlayingEvents(void) { bool bReturn(false); time_t iNow; - CSingleLock lock(m_critSection); + bool bFoundChanges(false); - CDateTime::GetCurrentDateTime().GetAsUTCDateTime().GetAsTime(iNow); - if (iNow >= m_iNextEpgActiveTagCheck) { - bool bFoundChanges(false); CSingleLock lock(m_critSection); - - for (map::iterator it = m_epgs.begin(); it != m_epgs.end(); it++) - bFoundChanges = it->second->CheckPlayingEvent() || bFoundChanges; - CDateTime::GetCurrentDateTime().GetAsUTCDateTime().GetAsTime(m_iNextEpgActiveTagCheck); - m_iNextEpgActiveTagCheck += g_advancedSettings.m_iEpgActiveTagCheckInterval; - - if (bFoundChanges) + CDateTime::GetCurrentDateTime().GetAsUTCDateTime().GetAsTime(iNow); + if (iNow >= m_iNextEpgActiveTagCheck) { - SetChanged(); - NotifyObservers(ObservableMessageEpgActiveItem); - } + for (map::iterator it = m_epgs.begin(); it != m_epgs.end(); it++) + bFoundChanges = it->second->CheckPlayingEvent() || bFoundChanges; + CDateTime::GetCurrentDateTime().GetAsUTCDateTime().GetAsTime(m_iNextEpgActiveTagCheck); + m_iNextEpgActiveTagCheck += g_advancedSettings.m_iEpgActiveTagCheckInterval; - /* pvr tags always start on the full minute */ - if (g_PVRManager.IsStarted()) - m_iNextEpgActiveTagCheck -= m_iNextEpgActiveTagCheck % 60; + /* pvr tags always start on the full minute */ + if (g_PVRManager.IsStarted()) + m_iNextEpgActiveTagCheck -= m_iNextEpgActiveTagCheck % 60; - bReturn = true; + bReturn = true; + } } + if (bFoundChanges) + { + SetChanged(); + NotifyObservers(ObservableMessageEpgActiveItem); + } return bReturn; }