Skip to content

Commit

Permalink
Revert "[epg] avoid PVR thread to persist epg tables directly (sync i…
Browse files Browse the repository at this point in the history
…ssue with epg thread)"

this change makes no sense. It triggers Persist for systems that want to ignore DB

This reverts commit be24ceb.
  • Loading branch information
FernetMenta authored and popcornmix committed Apr 10, 2016
1 parent 28b3c44 commit ae73ee6
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 28 deletions.
16 changes: 0 additions & 16 deletions xbmc/epg/EpgContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ CEpgContainer::CEpgContainer(void) :
m_bIsInitialising = true;
m_iNextEpgId = 0;
m_bPreventUpdates = false;
m_bMarkForPersist = false;
m_updateEvent.Reset();
m_bStarted = false;
m_bLoaded = false;
Expand Down Expand Up @@ -266,14 +265,6 @@ void CEpgContainer::LoadFromDB(void)
m_bLoaded = bLoaded;
}

bool CEpgContainer::MarkTablesForPersist(void)
{
/* Set m_bMarkForPersist to persist tables on the next Process() run but only
if epg.ignoredbforclient is set, otherwise persistAll does already persisting. */
CSingleLock lock(m_critSection);
return m_bMarkForPersist = CSettings::GetInstance().GetBool(CSettings::SETTING_EPG_IGNOREDBFORCLIENT);
}

bool CEpgContainer::PersistTables(void)
{
m_critSection.lock();
Expand Down Expand Up @@ -364,13 +355,6 @@ void CEpgContainer::Process(void)
if (!m_bStop)
CheckPlayingEvents();

/* Check if PVR requests an update of Epg Channels */
if (m_bMarkForPersist)
{
PersistTables();
m_bMarkForPersist = false;
}

/* check for changes that need to be saved every 60 seconds */
if (iNow - iLastSave > 60)
{
Expand Down
11 changes: 0 additions & 11 deletions xbmc/epg/EpgContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,22 +233,12 @@ namespace EPG
*/
bool IsInitialising(void) const;

/*!
* @brief Set m_bMarkForPersist to force PersistTables() on next Process() run
* @return True when m_bMarkForPersist was set.
*/
bool MarkTablesForPersist(void);

/*!
* @brief Call Persist() on each table
* @return True when they all were persisted, false otherwise.
*/
bool PersistAll(void);

/*!
* @brief Call Persist() on each table
* @return True when they all were persisted, false otherwise.
*/
bool PersistTables(void);

/*!
Expand Down Expand Up @@ -309,7 +299,6 @@ namespace EPG
bool m_bStarted; /*!< true if EpgContainer has fully started */
bool m_bLoaded; /*!< true after epg data is initially loaded from the database */
bool m_bPreventUpdates; /*!< true to prevent EPG updates */
bool m_bMarkForPersist; /*!< true to update channel Epgs called from PVR */
int m_pendingUpdates; /*!< count of pending manual updates */
time_t m_iLastEpgCleanup; /*!< the time the EPG was cleaned up */
time_t m_iNextEpgUpdate; /*!< the time the EPG will be updated */
Expand Down
2 changes: 1 addition & 1 deletion xbmc/pvr/channels/PVRChannelGroupInternal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ bool CPVRChannelGroupInternal::CreateChannelEpgs(bool bForce /* = false */)

if (HasChangedChannels())
{
g_EpgContainer.MarkTablesForPersist();
g_EpgContainer.PersistTables();
return Persist();
}

Expand Down

0 comments on commit ae73ee6

Please sign in to comment.