Skip to content

Commit

Permalink
[epg] fixed - set pvr channel pointer before trying to update epg tab…
Browse files Browse the repository at this point in the history
…les, and skip table updates when the pvr manager isn't started. fixes tables being deleted when they couldn't be updated and the channel pointer is invalid
  • Loading branch information
opdenkamp committed Dec 21, 2012
1 parent 736b6dc commit 3850069
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions xbmc/epg/EpgContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,18 @@ bool CEpgContainer::UpdateEPG(bool bOnlyPending /* = false */)
if (bShowProgress && !bOnlyPending)
UpdateProgressDialog(++iCounter, m_epgs.size(), epg->Name());

// we currently only support update via pvr add-ons. skip update when the pvr manager isn't started
if (!g_PVRManager.IsStarted())
continue;

// check the pvr manager when the channel pointer isn't set
if (!epg->Channel())
{
CPVRChannelPtr channel = g_PVRChannelGroups->GetChannelByEpgId(epg->EpgID());
if (channel)
epg->SetChannel(channel);
}

if ((!bOnlyPending || epg->UpdatePending()) && epg->Update(start, end, m_iUpdateTime, bOnlyPending))
iUpdatedTables++;
else if (!epg->IsValid())
Expand Down

0 comments on commit 3850069

Please sign in to comment.