diff --git a/packages/mediacenter/xbmc-pvr/patches/xbmc-pvr-b485416-903-pvr_fix_deadlock_when_switching_to_a_channel.patch b/packages/mediacenter/xbmc-pvr/patches/xbmc-pvr-b485416-903-pvr_fix_deadlock_when_switching_to_a_channel.patch new file mode 100644 index 0000000000..c015676da4 --- /dev/null +++ b/packages/mediacenter/xbmc-pvr/patches/xbmc-pvr-b485416-903-pvr_fix_deadlock_when_switching_to_a_channel.patch @@ -0,0 +1,54 @@ +From 5eb53947a50f951b019d16987630393ffabea008 Mon Sep 17 00:00:00 2001 +From: Lars Op den Kamp +Date: Tue, 19 Jul 2011 01:35:30 +0200 +Subject: [PATCH] pvr: fix deadlock when switching to a channel that's unavailable + +--- + xbmc/cores/dvdplayer/DVDPlayer.cpp | 5 +++++ + xbmc/pvr/PVRManager.cpp | 14 ++++++++------ + 2 files changed, 13 insertions(+), 6 deletions(-) + +diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp +index 824391e..90bcc0c 100644 +--- a/xbmc/cores/dvdplayer/DVDPlayer.cpp ++++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp +@@ -2266,6 +2266,11 @@ void CDVDPlayer::HandleMessages() + SetCaching(CACHESTATE_PVR); + } + } ++ else ++ { ++ CLog::Log(LOGWARNING, "%s - failed to switch channel. playback stopped", __FUNCTION__); ++ CloseFile(); ++ } + } + } + else if (pMsg->IsType(CDVDMsg::GENERAL_GUI_ACTION)) +diff --git a/xbmc/pvr/PVRManager.cpp b/xbmc/pvr/PVRManager.cpp +index cfc8d3d..6cad52b 100644 +--- a/xbmc/pvr/PVRManager.cpp ++++ b/xbmc/pvr/PVRManager.cpp +@@ -676,12 +676,14 @@ void CPVRManager::SetPlayingGroup(CPVRChannelGroup *group) + + CPVRChannelGroup *CPVRManager::GetPlayingGroup(bool bRadio /* = false */) + { +- CSingleLock lock(m_critSection); +- +- if (bRadio && !m_currentRadioGroup) +- SetPlayingGroup((CPVRChannelGroup *) m_channelGroups->GetGroupAllRadio()); +- else if (!bRadio &&!m_currentTVGroup) +- SetPlayingGroup((CPVRChannelGroup *) m_channelGroups->GetGroupAllTV()); ++ CSingleTryLock tryLock(m_critSection); ++ if(tryLock.IsOwner()) ++ { ++ if (bRadio && !m_currentRadioGroup) ++ SetPlayingGroup((CPVRChannelGroup *) m_channelGroups->GetGroupAllRadio()); ++ else if (!bRadio &&!m_currentTVGroup) ++ SetPlayingGroup((CPVRChannelGroup *) m_channelGroups->GetGroupAllTV()); ++ } + + return bRadio ? m_currentRadioGroup : m_currentTVGroup; + } +-- +1.7.4.1 +