Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' into pvr-ppa

  • Loading branch information...
commit 99c0b4148a3e321b8c38ea6a52d51a185491dbbd 2 parents 760c0c6 + 5b3907c
@opdenkamp authored
View
4 xbmc/epg/Epg.cpp
@@ -514,7 +514,7 @@ bool CEpg::UpdateEntries(const CEpg &epg, bool bStoreInDb /* = true */)
FixOverlappingEvents(false);
/* update the last scan time of this table */
- m_lastScanTime = CDateTime::GetCurrentDateTime();
+ m_lastScanTime = CDateTime::GetCurrentDateTime().GetAsUTCDateTime();
/* update the first and last date */
UpdateFirstAndLastDates();
@@ -593,7 +593,7 @@ bool CEpg::Update(const time_t start, const time_t end, int iUpdateTime)
/* check if we have to update */
time_t iNow = 0;
time_t iLastUpdate = 0;
- CDateTime::GetCurrentDateTime().GetAsTime(iNow);
+ CDateTime::GetCurrentDateTime().GetAsUTCDateTime().GetAsTime(iNow);
lastScanTime.GetAsTime(iLastUpdate);
bUpdate = (iNow > iLastUpdate + iUpdateTime);
View
4 xbmc/epg/EpgContainer.cpp
@@ -174,7 +174,7 @@ void CEpgContainer::Process(void)
bool bUpdateEpg(true);
while (!m_bStop && !g_application.m_bStop)
{
- CDateTime::GetCurrentDateTime().GetAsTime(iNow);
+ CDateTime::GetCurrentDateTime().GetAsUTCDateTime().GetAsTime(iNow);
lock.Enter();
bUpdateEpg = (iNow >= m_iNextEpgUpdate || !bLoaded);
lock.Leave();
@@ -474,7 +474,7 @@ bool CEpgContainer::UpdateEPG(bool bShowProgress /* = false */)
{
/* the update has been interrupted. try again later */
time_t iNow;
- CDateTime::GetCurrentDateTime().GetAsTime(iNow);
+ CDateTime::GetCurrentDateTime().GetAsUTCDateTime().GetAsTime(iNow);
m_iNextEpgUpdate = iNow + g_advancedSettings.m_iEpgRetryInterruptedUpdateInterval;
}
lock.Leave();
View
6 xbmc/pvr/channels/PVRChannelGroup.cpp
@@ -95,7 +95,8 @@ int CPVRChannelGroup::Load(void)
/* make sure this container is empty before loading */
Unload();
- m_bUsingBackendChannelOrder = g_guiSettings.GetBool("pvrmanager.backendchannelorder");
+ m_bUsingBackendChannelOrder = g_guiSettings.GetBool("pvrmanager.backendchannelorder");
+ m_bUsingBackendChannelNumbers = g_guiSettings.GetBool("pvrmanager.usebackendchannelnumbers");
int iChannelCount = m_iGroupId > 0 ? LoadFromDb() : 0;
CLog::Log(LOGDEBUG, "PVRChannelGroup - %s - %d channels loaded from the database for group '%s'",
@@ -922,12 +923,13 @@ void CPVRChannelGroup::Notify(const Observable &obs, const CStdString& msg)
bool bUsingBackendChannelOrder = g_guiSettings.GetBool("pvrmanager.backendchannelorder");
bool bUsingBackendChannelNumbers = g_guiSettings.GetBool("pvrmanager.usebackendchannelnumbers");
bool bChannelNumbersChanged = m_bUsingBackendChannelNumbers != bUsingBackendChannelNumbers;
+ bool bChannelOrderChanged = m_bUsingBackendChannelOrder != bUsingBackendChannelOrder;
m_bUsingBackendChannelOrder = bUsingBackendChannelOrder;
m_bUsingBackendChannelNumbers = bUsingBackendChannelNumbers;
/* check whether this channel group has to be renumbered */
- if (m_bUsingBackendChannelOrder || bChannelNumbersChanged)
+ if (bChannelOrderChanged || bChannelNumbersChanged)
{
CLog::Log(LOGDEBUG, "CPVRChannelGroup - %s - renumbering group '%s' to use the backend channel order and/or numbers",
__FUNCTION__, m_strGroupName.c_str());
View
23 xbmc/pvr/channels/PVRChannelGroups.cpp
@@ -49,6 +49,7 @@ CPVRChannelGroups::~CPVRChannelGroups(void)
void CPVRChannelGroups::Clear(void)
{
+ CSingleLock lock(m_critSection);
for (unsigned int iGroupPtr = 0; iGroupPtr < size(); iGroupPtr++)
delete at(iGroupPtr);
@@ -66,6 +67,7 @@ bool CPVRChannelGroups::GetGroupsFromClients(void)
bool CPVRChannelGroups::UpdateFromClient(const CPVRChannelGroup &group)
{
+ CSingleLock lock(m_critSection);
CPVRChannelGroup *newGroup = new CPVRChannelGroup(group.IsRadio(), -1, group.GroupName());
push_back(newGroup);
@@ -125,6 +127,7 @@ const CPVRChannelGroup *CPVRChannelGroups::GetById(int iGroupId) const
const CPVRChannelGroup *CPVRChannelGroups::GetByName(const CStdString &strName) const
{
CPVRChannelGroup *group = NULL;
+ CSingleLock lock(m_critSection);
for (unsigned int iGroupPtr = 0; iGroupPtr < size(); iGroupPtr++)
{
@@ -141,6 +144,7 @@ const CPVRChannelGroup *CPVRChannelGroups::GetByName(const CStdString &strName)
int CPVRChannelGroups::GetIndexForGroupID(int iGroupId) const
{
int iReturn = -1;
+ CSingleLock lock(m_critSection);
for (unsigned int iGroupPtr = 0; iGroupPtr < size(); iGroupPtr++)
{
@@ -157,6 +161,7 @@ int CPVRChannelGroups::GetIndexForGroupID(int iGroupId) const
int CPVRChannelGroups::GetIndexForGroupName(const CStdString &strName) const
{
int iReturn = -1;
+ CSingleLock lock(m_critSection);
for (unsigned int iGroupPtr = 0; iGroupPtr < size(); iGroupPtr++)
{
@@ -172,6 +177,7 @@ int CPVRChannelGroups::GetIndexForGroupName(const CStdString &strName) const
void CPVRChannelGroups::RemoveFromAllGroups(CPVRChannel *channel)
{
+ CSingleLock lock(m_critSection);
/* start at position 2 because channels are only deleted from non-system groups.
system groups are entries 0 and 1 */
for (unsigned int iGroupPtr = 2; iGroupPtr < size(); iGroupPtr++)
@@ -188,6 +194,8 @@ bool CPVRChannelGroups::Update(bool bChannelsOnly /* = false */)
if (!bChannelsOnly)
GetGroupsFromClients();
+ CSingleLock lock(m_critSection);
+
/* only update the internal group if group syncing is disabled */
unsigned int iUpdateGroups = !bChannelsOnly && g_guiSettings.GetBool("pvrmanager.syncchannelgroups") ? size() : 1;
@@ -203,6 +211,7 @@ bool CPVRChannelGroups::Update(bool bChannelsOnly /* = false */)
bool CPVRChannelGroups::UpdateGroupsEntries(const CPVRChannelGroups &groups)
{
+ CSingleLock lock(m_critSection);
/* go through the groups list and check for new groups */
for (unsigned int iGroupPtr = 0; iGroupPtr < groups.size(); iGroupPtr++)
{
@@ -227,6 +236,8 @@ bool CPVRChannelGroups::LoadUserDefinedChannelGroups(void)
if (!database)
return false;
+ CSingleLock lock(m_critSection);
+
/* load the other groups from the database */
int iSize = size();
database->Get(*this);
@@ -247,6 +258,7 @@ bool CPVRChannelGroups::LoadUserDefinedChannelGroups(void)
bool CPVRChannelGroups::Load(void)
{
+ CSingleLock lock(m_critSection);
CLog::Log(LOGDEBUG, "PVRChannelGroups - %s - loading all %s channel groups",
__FUNCTION__, m_bRadio ? "radio" : "TV");
@@ -269,7 +281,7 @@ bool CPVRChannelGroups::Load(void)
bool CPVRChannelGroups::PersistAll(void)
{
bool bReturn = true;
-
+ CSingleLock lock(m_critSection);
CLog::Log(LOGDEBUG, "CPVRChannelGroups - %s - persisting all changes in channel groups", __FUNCTION__);
for (unsigned int iGroupPtr = 0; iGroupPtr < size(); iGroupPtr++)
@@ -280,6 +292,7 @@ bool CPVRChannelGroups::PersistAll(void)
CPVRChannelGroupInternal *CPVRChannelGroups::GetGroupAll(void) const
{
+ CSingleLock lock(m_critSection);
if (size() > 0)
return (CPVRChannelGroupInternal *) at(0);
else
@@ -289,6 +302,7 @@ CPVRChannelGroupInternal *CPVRChannelGroups::GetGroupAll(void) const
int CPVRChannelGroups::GetGroupList(CFileItemList* results) const
{
int iReturn = 0;
+ CSingleLock lock(m_critSection);
CStdString strPath;
for (unsigned int iGroupPtr = 0; iGroupPtr < size(); iGroupPtr++)
@@ -328,6 +342,7 @@ int CPVRChannelGroups::GetPreviousGroupID(int iGroupId) const
const CPVRChannelGroup *CPVRChannelGroups::GetPreviousGroup(const CPVRChannelGroup &group) const
{
const CPVRChannelGroup *returnGroup = NULL;
+ CSingleLock lock(m_critSection);
int iCurrentGroupIndex = GetIndexForGroupID(group.GroupID());
if (iCurrentGroupIndex - 1 < 0)
@@ -353,6 +368,7 @@ int CPVRChannelGroups::GetNextGroupID(int iGroupId) const
CPVRChannelGroup *CPVRChannelGroups::GetNextGroup(const CPVRChannelGroup &group) const
{
CPVRChannelGroup *returnGroup = NULL;
+ CSingleLock lock(m_critSection);
int iCurrentGroupIndex = GetIndexForGroupID(group.GroupID());
if (iCurrentGroupIndex + 1 >= (int)size())
@@ -369,6 +385,7 @@ CPVRChannelGroup *CPVRChannelGroups::GetNextGroup(const CPVRChannelGroup &group)
bool CPVRChannelGroups::AddGroup(const CStdString &strName)
{
bool bReturn = false;
+ CSingleLock lock(m_critSection);
CPVRChannelGroup *group = (CPVRChannelGroup *) GetByName(strName);
if (!group)
@@ -390,6 +407,7 @@ bool CPVRChannelGroups::AddGroup(const CStdString &strName)
bool CPVRChannelGroups::DeleteGroup(const CPVRChannelGroup &group)
{
bool bReturn = false;
+ CSingleLock lock(m_critSection);
if (group.IsInternalGroup())
{
@@ -429,6 +447,7 @@ bool CPVRChannelGroups::DeleteGroup(const CPVRChannelGroup &group)
const CStdString &CPVRChannelGroups::GetGroupName(int iGroupId) const
{
+ CSingleLock lock(m_critSection);
for (unsigned int iGroupPtr = 0; iGroupPtr < size(); iGroupPtr++)
{
if (iGroupId == at(iGroupPtr)->GroupID())
@@ -440,6 +459,7 @@ const CStdString &CPVRChannelGroups::GetGroupName(int iGroupId) const
int CPVRChannelGroups::GetGroupId(CStdString strGroupName) const
{
+ CSingleLock lock(m_critSection);
for (unsigned int iGroupPtr = 0; iGroupPtr < size(); iGroupPtr++)
{
if (strGroupName == at(iGroupPtr)->GroupName())
@@ -451,6 +471,7 @@ int CPVRChannelGroups::GetGroupId(CStdString strGroupName) const
bool CPVRChannelGroups::AddChannelToGroup(CPVRChannel *channel, int iGroupId)
{
bool bReturn = false;
+ CSingleLock lock(m_critSection);
CPVRChannelGroup *group = (CPVRChannelGroup *) GetById(iGroupId);
if (group)
{
View
48 xbmc/pvr/channels/PVRChannelGroups.h
@@ -38,30 +38,6 @@ namespace PVR
{
friend class CPVRChannelGroupsContainer;
- private:
- bool m_bRadio; /*!< true if this is a container for radio channels, false if it is for tv channels */
- CCriticalSection m_critSection;
-
- /*!
- * @brief Get the index in this container of the channel group with the given ID.
- * @param iGroupId The ID to find.
- * @return The index or -1 if it wasn't found.
- */
- int GetIndexForGroupID(int iGroupId) const;
- int GetIndexForGroupName(const CStdString &strName) const;
- bool LoadUserDefinedChannelGroups(void);
- bool GetGroupsFromClients(void);
-
- protected:
- /*!
- * @brief Update the contents of the groups in this container.
- * @param bChannelsOnly Set to true to only update channels, not the groups themselves.
- * @return True if the update was successful, false otherwise.
- */
- bool Update(bool bChannelsOnly = false);
-
- bool UpdateGroupsEntries(const CPVRChannelGroups &groups);
-
public:
/*!
* @brief Create a new group container.
@@ -201,5 +177,29 @@ namespace PVR
bool PersistAll(void);
bool IsRadio(void) const { return m_bRadio; }
+
+ protected:
+ /*!
+ * @brief Update the contents of the groups in this container.
+ * @param bChannelsOnly Set to true to only update channels, not the groups themselves.
+ * @return True if the update was successful, false otherwise.
+ */
+ bool Update(bool bChannelsOnly = false);
+
+ bool UpdateGroupsEntries(const CPVRChannelGroups &groups);
+
+ private:
+ bool m_bRadio; /*!< true if this is a container for radio channels, false if it is for tv channels */
+ CCriticalSection m_critSection;
+
+ /*!
+ * @brief Get the index in this container of the channel group with the given ID.
+ * @param iGroupId The ID to find.
+ * @return The index or -1 if it wasn't found.
+ */
+ int GetIndexForGroupID(int iGroupId) const;
+ int GetIndexForGroupName(const CStdString &strName) const;
+ bool LoadUserDefinedChannelGroups(void);
+ bool GetGroupsFromClients(void);
};
}
Please sign in to comment.
Something went wrong with that request. Please try again.