aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Sommerfeld <kai.sommerfeld@gmx.com>2018-01-01 14:38:21 +0100
committerKai Sommerfeld <kai.sommerfeld@gmx.com>2018-01-02 00:10:26 +0100
commita3a36a4f78e9fe3748559b055988dc41c902eac9 (patch)
tree8dd25a0a0072482fac03f7c2613a56a260258161
parent3e7ef02af5505c559c6abd36996d018cfa5ca266 (diff)
[PVR] Fix timeshift gui info. Must be reset if nothing is playing anymore.
-rw-r--r--xbmc/pvr/PVRGUIInfo.cpp17
-rw-r--r--xbmc/pvr/PVRGUIInfo.h1
2 files changed, 17 insertions, 1 deletions
diff --git a/xbmc/pvr/PVRGUIInfo.cpp b/xbmc/pvr/PVRGUIInfo.cpp
index 4e18343eac..3e86520604 100644
--- a/xbmc/pvr/PVRGUIInfo.cpp
+++ b/xbmc/pvr/PVRGUIInfo.cpp
@@ -81,6 +81,7 @@ void CPVRGUIInfo::ResetProperties(void)
m_bCanRecordPlayingChannel = false;
m_bHasTVChannels = false;
m_bHasRadioChannels = false;
+ m_bHasTimeshiftData = false;
m_bIsTimeshifting = false;
m_iStartTime = time_t(0);
m_iTimeshiftStartTime = time_t(0);
@@ -246,8 +247,20 @@ void CPVRGUIInfo::UpdateTimeshift(void)
{
if (!CServiceBroker::GetPVRManager().IsPlayingTV() && !CServiceBroker::GetPVRManager().IsPlayingRadio())
{
+ // If nothing is playing (anymore), there is no need to poll the timeshift values from the clients.
CSingleLock lock(m_critSection);
- m_iStartTime = 0;
+ if (m_bHasTimeshiftData)
+ {
+ m_bHasTimeshiftData = false;
+ m_bIsTimeshifting = false;
+ m_iStartTime = 0;
+ m_iTimeshiftStartTime = 0;
+ m_iTimeshiftEndTime = 0;
+ m_iTimeshiftPlayTime = 0;
+ m_strTimeshiftStartTime.clear();
+ m_strTimeshiftEndTime.clear();
+ m_strTimeshiftPlayTime.clear();
+ }
return;
}
@@ -282,6 +295,8 @@ void CPVRGUIInfo::UpdateTimeshift(void)
tmp.SetFromUTCDateTime(m_iTimeshiftPlayTime);
m_strTimeshiftPlayTime = tmp.GetAsLocalizedTime("", true);
+
+ m_bHasTimeshiftData = true;
}
bool CPVRGUIInfo::TranslateCharInfo(DWORD dwInfo, std::string &strValue) const
diff --git a/xbmc/pvr/PVRGUIInfo.h b/xbmc/pvr/PVRGUIInfo.h
index 8af9629c0b..2a04e5f071 100644
--- a/xbmc/pvr/PVRGUIInfo.h
+++ b/xbmc/pvr/PVRGUIInfo.h
@@ -261,6 +261,7 @@ namespace PVR
CPVREpgInfoTagPtr m_playingEpgTag;
std::vector<SBackend> m_backendProperties;
+ bool m_bHasTimeshiftData;
bool m_bIsTimeshifting;
time_t m_iStartTime;
time_t m_iTimeshiftStartTime;