Skip to content
This repository has been archived by the owner on Apr 15, 2023. It is now read-only.

Commit

Permalink
Merge pull request #263 from energy6/pvr-issue256-gui-stutter-1
Browse files Browse the repository at this point in the history
[FIX] The XBMC GUI stutters if the PVRClient connection runs into timeout
  • Loading branch information
Lars Op den Kamp committed Oct 19, 2011
2 parents 46cff28 + 743f76d commit 57a3c62
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions xbmc/pvr/addons/PVRClients.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1069,8 +1069,6 @@ void CPVRClients::StartChannelScan(void)

int CPVRClients::AddClientToDb(const AddonPtr client)
{
CSingleLock lock(m_critSection);

/* add this client to the database if it's not in there yet */
CPVRDatabase *database = OpenPVRDatabase();
int iClientDbId = database ? database->AddClient(client->Name(), client->ID()) : -1;
Expand Down Expand Up @@ -1107,7 +1105,6 @@ bool CPVRClients::InitialiseClient(AddonPtr client)
if (!client->Enabled())
return bReturn;

CSingleLock lock(m_critSection);
CLog::Log(LOGDEBUG, "%s - initialising add-on '%s'", __FUNCTION__, client->Name().c_str());

/* register this client in the db */
Expand All @@ -1119,7 +1116,10 @@ bool CPVRClients::InitialiseClient(AddonPtr client)
boost::shared_ptr<CPVRClient> addon = boost::dynamic_pointer_cast<CPVRClient>(client);
if (addon && addon->Create(iClientId))
{
m_clientMap.insert(std::make_pair(iClientId, addon));
{
CSingleLock lock(m_critSection);
m_clientMap.insert(std::make_pair(iClientId, addon));
}
bReturn = true;
}
else
Expand All @@ -1134,7 +1134,6 @@ bool CPVRClients::InitialiseClient(AddonPtr client)
bool CPVRClients::UpdateAndInitialiseClients(bool bInitialiseAllClients /* = false */)
{
bool bReturn(false);
CSingleLock lock(m_critSection);

/* make sure that the callback is registered */
CAddonMgr::Get().RegisterAddonMgrCallback(ADDON_PVRDLL, this);
Expand Down Expand Up @@ -1163,7 +1162,10 @@ bool CPVRClients::UpdateAndInitialiseClients(bool bInitialiseAllClients /* = fal
}

/* check whether all clients are (still) connected */
m_bAllClientsConnected = ConnectedClientAmount() == EnabledClientAmount();
{
CSingleLock lock(m_critSection);
m_bAllClientsConnected = (ConnectedClientAmount() == EnabledClientAmount());
}

return bReturn;
}
Expand Down

0 comments on commit 57a3c62

Please sign in to comment.