Browse files

Merge pull request #5269 from FernetMenta/pvr

pvr: fix deadlock caused by pollling channel group name
  • Loading branch information...
2 parents fe0970c + a99bdfe commit f60bdf7715b6808f85a549a32d0e422e23bf765f @FernetMenta FernetMenta committed Aug 25, 2014
Showing with 25 additions and 1 deletion.
  1. +1 −1 xbmc/GUIInfoManager.cpp
  2. +7 −0 xbmc/pvr/PVRGUIInfo.cpp
  3. +6 −0 xbmc/pvr/PVRGUIInfo.h
  4. +5 −0 xbmc/pvr/PVRManager.cpp
  5. +6 −0 xbmc/pvr/PVRManager.h
View
2 xbmc/GUIInfoManager.cpp
@@ -3829,7 +3829,7 @@ CStdString CGUIInfoManager::GetVideoLabel(int item)
case VIDEOPLAYER_CHANNEL_GROUP:
{
if (tag && !tag->IsRadio())
- return g_PVRManager.GetPlayingGroup(false)->GroupName();
+ return g_PVRManager.GetPlayingTVGroupName();
}
}
}
View
7 xbmc/pvr/PVRGUIInfo.cpp
@@ -258,6 +258,7 @@ void CPVRGUIInfo::UpdateMisc(void)
bool bIsPlayingEncryptedStream = bStarted && g_PVRClients->IsEncrypted();
bool bHasTVChannels = bStarted && g_PVRChannelGroups->GetGroupAllTV()->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 */
bool bHasNonRecordingTimers = bStarted && m_iTimerAmount - m_iRecordingTimerAmount > 0;
@@ -272,6 +273,7 @@ void CPVRGUIInfo::UpdateMisc(void)
m_bIsPlayingEncryptedStream = bIsPlayingEncryptedStream;
m_bHasTVChannels = bHasTVChannels;
m_bHasRadioChannels = bHasRadioChannels;
+ m_strPlayingTVGroup = strPlayingTVGroup;
}
bool CPVRGUIInfo::TranslateCharInfo(DWORD dwInfo, std::string &strValue) const
@@ -898,3 +900,8 @@ void CPVRGUIInfo::UpdatePlayingTag(void)
m_iDuration = recording.GetDuration() * 1000;
}
}
+
+std::string CPVRGUIInfo::GetPlayingTVGroup()
+{
+ return m_strPlayingTVGroup;
+}
View
6 xbmc/pvr/PVRGUIInfo.h
@@ -77,6 +77,11 @@ namespace PVR
bool GetPlayingTag(EPG::CEpgInfoTag &tag) const;
+ /*!
+ * @brief Get playing TV group.
+ */
+ std::string GetPlayingTVGroup();
+
private:
void ResetProperties(void);
void ClearQualityInfo(PVR_SIGNAL_STATUS &qualityInfo);
@@ -162,6 +167,7 @@ namespace PVR
bool m_bIsPlayingEncryptedStream;
bool m_bHasTVChannels;
bool m_bHasRadioChannels;
+ std::string m_strPlayingTVGroup;
//@}
PVR_SIGNAL_STATUS m_qualityInfo; /*!< stream quality information */
View
5 xbmc/pvr/PVRManager.cpp
@@ -1614,3 +1614,8 @@ bool CPVRManager::CreateChannelEpgs(void)
m_bEpgsCreated = m_channelGroups->CreateChannelEpgs();
return m_bEpgsCreated;
}
+
+std::string CPVRManager::GetPlayingTVGroupName()
+{
+ return IsStarted() && m_guiInfo ? m_guiInfo->GetPlayingTVGroup() : "";
+}
View
6 xbmc/pvr/PVRManager.h
@@ -548,6 +548,12 @@ namespace PVR
*/
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:
/*!
* @brief PVR update and control thread.

0 comments on commit f60bdf7

Please sign in to comment.