Permalink
Browse files

pvr: don't switch the channel when showing a preview

  • Loading branch information...
1 parent f2edd38 commit 24d83d97dfbb0b4986625d97524c718f2f1af70d @opdenkamp opdenkamp committed May 26, 2011
Showing with 10 additions and 5 deletions.
  1. +10 −5 xbmc/pvr/PVRManager.cpp
View
@@ -912,15 +912,16 @@ bool CPVRManager::PerformChannelSwitch(const CPVRChannel &channel, bool bPreview
__FUNCTION__, channel.ChannelName().c_str());
/* make sure that channel settings are persisted */
- SaveCurrentChannelSettings();
+ if (!bPreview)
+ SaveCurrentChannelSettings();
if (m_currentFile)
{
delete m_currentFile;
m_currentFile = NULL;
}
- if (channel.ClientID() < 0 || !m_addons->SwitchChannel(channel))
+ if (!bPreview && (channel.ClientID() < 0 || !m_addons->SwitchChannel(channel)))
{
CLog::Log(LOGERROR, "PVRManager - %s - failed to switch to channel '%s'",
__FUNCTION__, channel.ChannelName().c_str());
@@ -929,10 +930,14 @@ bool CPVRManager::PerformChannelSwitch(const CPVRChannel &channel, bool bPreview
}
m_currentFile = new CFileItem(channel);
- LoadCurrentChannelSettings();
- CLog::Log(LOGNOTICE, "PVRManager - %s - switched to channel '%s'",
- __FUNCTION__, channel.ChannelName().c_str());
+ if (!bPreview)
+ {
+ LoadCurrentChannelSettings();
+
+ CLog::Log(LOGNOTICE, "PVRManager - %s - switched to channel '%s'",
+ __FUNCTION__, channel.ChannelName().c_str());
+ }
return true;
}

0 comments on commit 24d83d9

Please sign in to comment.