From 33e75dcf6608b18abc7cbcfc833ce2f1ba8904a6 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Wed, 14 Mar 2018 11:44:48 +0100 Subject: [PVR] PVRGUIChannelNavigator: Optimize to only call CGUIInfoManager::SetCurrentItem if the channel to play/preview actually has changed. --- xbmc/pvr/PVRGUIChannelNavigator.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/xbmc/pvr/PVRGUIChannelNavigator.cpp b/xbmc/pvr/PVRGUIChannelNavigator.cpp index a08eaf966c..fbd8cdd403 100644 --- a/xbmc/pvr/PVRGUIChannelNavigator.cpp +++ b/xbmc/pvr/PVRGUIChannelNavigator.cpp @@ -179,10 +179,12 @@ namespace PVR m_iChannelInfoJobId = -1; } - m_currentChannel = m_playingChannel; - - if (m_currentChannel) - item.reset(new CFileItem(m_playingChannel)); + if (m_currentChannel != m_playingChannel) + { + m_currentChannel = m_playingChannel; + if (m_playingChannel) + item.reset(new CFileItem(m_playingChannel)); + } } if (item) @@ -206,9 +208,12 @@ namespace PVR CSingleLock lock(m_critSection); m_playingChannel = channel; - m_currentChannel = m_playingChannel; - - item.reset(new CFileItem(m_playingChannel)); + if (m_currentChannel != m_playingChannel) + { + m_currentChannel = m_playingChannel; + if (m_playingChannel) + item.reset(new CFileItem(m_playingChannel)); + } } if (item) -- cgit v1.2.3