Skip to content

Commit

Permalink
Merge pull request #5269 from FernetMenta/pvr
Browse files Browse the repository at this point in the history
pvr: fix deadlock caused by pollling channel group name
  • Loading branch information
FernetMenta committed Aug 25, 2014
2 parents fe0970c + a99bdfe commit f60bdf7
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion xbmc/GUIInfoManager.cpp
Expand Up @@ -3829,7 +3829,7 @@ CStdString CGUIInfoManager::GetVideoLabel(int item)
case VIDEOPLAYER_CHANNEL_GROUP: case VIDEOPLAYER_CHANNEL_GROUP:
{ {
if (tag && !tag->IsRadio()) if (tag && !tag->IsRadio())
return g_PVRManager.GetPlayingGroup(false)->GroupName(); return g_PVRManager.GetPlayingTVGroupName();
} }
} }
} }
Expand Down
7 changes: 7 additions & 0 deletions xbmc/pvr/PVRGUIInfo.cpp
Expand Up @@ -258,6 +258,7 @@ void CPVRGUIInfo::UpdateMisc(void)
bool bIsPlayingEncryptedStream = bStarted && g_PVRClients->IsEncrypted(); bool bIsPlayingEncryptedStream = bStarted && g_PVRClients->IsEncrypted();
bool bHasTVChannels = bStarted && g_PVRChannelGroups->GetGroupAllTV()->HasChannels(); bool bHasTVChannels = bStarted && g_PVRChannelGroups->GetGroupAllTV()->HasChannels();
bool bHasRadioChannels = bStarted && g_PVRChannelGroups->GetGroupAllRadio()->HasChannels(); bool bHasRadioChannels = bStarted && g_PVRChannelGroups->GetGroupAllRadio()->HasChannels();
std::string strPlayingTVGroup = (bStarted && bIsPlayingTV) ? g_PVRManager.GetPlayingGroup(false)->GroupName() : "";


/* safe to fetch these unlocked, since they're updated from the same thread as this one */ /* safe to fetch these unlocked, since they're updated from the same thread as this one */
bool bHasNonRecordingTimers = bStarted && m_iTimerAmount - m_iRecordingTimerAmount > 0; bool bHasNonRecordingTimers = bStarted && m_iTimerAmount - m_iRecordingTimerAmount > 0;
Expand All @@ -272,6 +273,7 @@ void CPVRGUIInfo::UpdateMisc(void)
m_bIsPlayingEncryptedStream = bIsPlayingEncryptedStream; m_bIsPlayingEncryptedStream = bIsPlayingEncryptedStream;
m_bHasTVChannels = bHasTVChannels; m_bHasTVChannels = bHasTVChannels;
m_bHasRadioChannels = bHasRadioChannels; m_bHasRadioChannels = bHasRadioChannels;
m_strPlayingTVGroup = strPlayingTVGroup;
} }


bool CPVRGUIInfo::TranslateCharInfo(DWORD dwInfo, std::string &strValue) const bool CPVRGUIInfo::TranslateCharInfo(DWORD dwInfo, std::string &strValue) const
Expand Down Expand Up @@ -898,3 +900,8 @@ void CPVRGUIInfo::UpdatePlayingTag(void)
m_iDuration = recording.GetDuration() * 1000; m_iDuration = recording.GetDuration() * 1000;
} }
} }

std::string CPVRGUIInfo::GetPlayingTVGroup()
{
return m_strPlayingTVGroup;
}
6 changes: 6 additions & 0 deletions xbmc/pvr/PVRGUIInfo.h
Expand Up @@ -77,6 +77,11 @@ namespace PVR


bool GetPlayingTag(EPG::CEpgInfoTag &tag) const; bool GetPlayingTag(EPG::CEpgInfoTag &tag) const;


/*!
* @brief Get playing TV group.
*/
std::string GetPlayingTVGroup();

private: private:
void ResetProperties(void); void ResetProperties(void);
void ClearQualityInfo(PVR_SIGNAL_STATUS &qualityInfo); void ClearQualityInfo(PVR_SIGNAL_STATUS &qualityInfo);
Expand Down Expand Up @@ -162,6 +167,7 @@ namespace PVR
bool m_bIsPlayingEncryptedStream; bool m_bIsPlayingEncryptedStream;
bool m_bHasTVChannels; bool m_bHasTVChannels;
bool m_bHasRadioChannels; bool m_bHasRadioChannels;
std::string m_strPlayingTVGroup;
//@} //@}


PVR_SIGNAL_STATUS m_qualityInfo; /*!< stream quality information */ PVR_SIGNAL_STATUS m_qualityInfo; /*!< stream quality information */
Expand Down
5 changes: 5 additions & 0 deletions xbmc/pvr/PVRManager.cpp
Expand Up @@ -1614,3 +1614,8 @@ bool CPVRManager::CreateChannelEpgs(void)
m_bEpgsCreated = m_channelGroups->CreateChannelEpgs(); m_bEpgsCreated = m_channelGroups->CreateChannelEpgs();
return m_bEpgsCreated; return m_bEpgsCreated;
} }

std::string CPVRManager::GetPlayingTVGroupName()
{
return IsStarted() && m_guiInfo ? m_guiInfo->GetPlayingTVGroup() : "";
}
6 changes: 6 additions & 0 deletions xbmc/pvr/PVRManager.h
Expand Up @@ -548,6 +548,12 @@ namespace PVR
*/ */
bool CreateChannelEpgs(void); bool CreateChannelEpgs(void);


/*!
* @brief get the name of the channel group of the current playing channel
* @return name of channel if tv channel is playing
*/
std::string GetPlayingTVGroupName();

protected: protected:
/*! /*!
* @brief PVR update and control thread. * @brief PVR update and control thread.
Expand Down

0 comments on commit f60bdf7

Please sign in to comment.