aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Sommerfeld <kai.sommerfeld@gmx.com>2018-03-13 17:18:54 +0100
committerKai Sommerfeld <kai.sommerfeld@gmx.com>2018-03-13 17:18:54 +0100
commit80334f59c9f868a5c2bfd2309f56385636653a5a (patch)
tree760412240cf8ee2613bf0b024615c7308f642d07
parent223a2c1488a3db0589837742b5fa3729633979bc (diff)
[PVR] PVRGUIInfo cleanup: Now, that vp does no longer call GetTotalTime/GetElapsedTime, nobody wants milliseconds anymore - seconds is sufficient granularity.
-rw-r--r--xbmc/GUIInfoManager.cpp4
-rw-r--r--xbmc/pvr/PVRGUIInfo.cpp21
-rw-r--r--xbmc/pvr/PVRGUIInfo.h9
-rw-r--r--xbmc/pvr/PVRManager.h9
4 files changed, 21 insertions, 22 deletions
diff --git a/xbmc/GUIInfoManager.cpp b/xbmc/GUIInfoManager.cpp
index e4774f5051..18407510a6 100644
--- a/xbmc/GUIInfoManager.cpp
+++ b/xbmc/GUIInfoManager.cpp
@@ -9067,8 +9067,8 @@ int CGUIInfoManager::GetEpgEventSeekPercent() const
int seekSize = g_application.GetAppPlayer().GetSeekHandler().GetSeekSize();
if (seekSize != 0)
{
- float elapsedTime = static_cast<float>(CServiceBroker::GetPVRManager().GetElapsedTime() / 1000);
- float totalTime = static_cast<float>(CServiceBroker::GetPVRManager().GetTotalTime() / 1000);
+ float elapsedTime = static_cast<float>(CServiceBroker::GetPVRManager().GetElapsedTime());
+ float totalTime = static_cast<float>(CServiceBroker::GetPVRManager().GetTotalTime());
float percentPerSecond = 100.0f / totalTime;
float percent = elapsedTime / totalTime * 100.0f + percentPerSecond * seekSize;
return std::lrintf(percent);
diff --git a/xbmc/pvr/PVRGUIInfo.cpp b/xbmc/pvr/PVRGUIInfo.cpp
index c883302cf3..fad14fe027 100644
--- a/xbmc/pvr/PVRGUIInfo.cpp
+++ b/xbmc/pvr/PVRGUIInfo.cpp
@@ -855,13 +855,13 @@ bool CPVRGUIInfo::GetVideoLabel(const CFileItem *item, int iLabel, std::string &
bool CPVRGUIInfo::GetSeekTimeLabel(int iSeekSize, std::string &strValue) const
{
- strValue = StringUtils::SecondsToTimeString(GetElapsedTime() / 1000 + iSeekSize, TIME_FORMAT_GUESS).c_str();
+ strValue = StringUtils::SecondsToTimeString(GetElapsedTime() + iSeekSize, TIME_FORMAT_GUESS).c_str();
return true;
}
void CPVRGUIInfo::CharInfoEpgEventDuration(std::string &strValue) const
{
- strValue = StringUtils::SecondsToTimeString(m_iDuration / 1000, TIME_FORMAT_GUESS).c_str();
+ strValue = StringUtils::SecondsToTimeString(m_iDuration, TIME_FORMAT_GUESS).c_str();
}
void CPVRGUIInfo::CharInfoTimeshiftStartTime(std::string &strValue) const
@@ -886,18 +886,18 @@ void CPVRGUIInfo::CharInfoTimeshiftOffset(std::string &strValue) const
void CPVRGUIInfo::CharInfoEpgEventElapsedTime(std::string &strValue) const
{
- strValue = StringUtils::SecondsToTimeString(GetElapsedTime() / 1000, TIME_FORMAT_GUESS).c_str();
+ strValue = StringUtils::SecondsToTimeString(GetElapsedTime(), TIME_FORMAT_GUESS).c_str();
}
void CPVRGUIInfo::CharInfoEpgEventRemainingTime(std::string &strValue) const
{
- strValue = StringUtils::SecondsToTimeString((m_iDuration - GetElapsedTime()) / 1000, TIME_FORMAT_GUESS).c_str();
+ strValue = StringUtils::SecondsToTimeString(m_iDuration - GetElapsedTime(), TIME_FORMAT_GUESS).c_str();
}
void CPVRGUIInfo::CharInfoEpgEventFinishTime(std::string &strValue) const
{
CDateTime finishTime = CDateTime::GetCurrentDateTime();
- finishTime += CDateTimeSpan(0, 0, 0, (m_iDuration - GetElapsedTime()) / 1000);
+ finishTime += CDateTimeSpan(0, 0, 0, m_iDuration - GetElapsedTime());
strValue = finishTime.GetAsLocalizedTime("", false);
}
@@ -1156,14 +1156,11 @@ int CPVRGUIInfo::GetElapsedTime(void) const
if (m_playingEpgTag || m_iTimeshiftStartTime)
{
- /* Calculate here the position we have of the running live TV event.
- * "position in ms" = ("current UTC" - "event start UTC") * 1000
- */
CDateTime current(m_iTimeshiftPlayTime);
CDateTime start = m_playingEpgTag ? CDateTime(m_playingEpgTag->StartAsUTC())
: CDateTime(m_iTimeshiftStartTime);
CDateTimeSpan time = current > start ? current - start : CDateTimeSpan(0, 0, 0, 0);
- return time.GetSecondsTotal() * 1000;
+ return time.GetSecondsTotal();
}
else
{
@@ -1204,12 +1201,12 @@ void CPVRGUIInfo::UpdatePlayingTag(void)
if (newTag)
{
m_playingEpgTag = newTag;
- m_iDuration = m_playingEpgTag->GetDuration() * 1000;
+ m_iDuration = m_playingEpgTag->GetDuration();
}
else if (m_iTimeshiftEndTime > m_iTimeshiftStartTime)
{
m_playingEpgTag.reset();
- m_iDuration = (m_iTimeshiftEndTime - m_iTimeshiftStartTime) * 1000;
+ m_iDuration = m_iTimeshiftEndTime - m_iTimeshiftStartTime;
}
else
{
@@ -1225,7 +1222,7 @@ void CPVRGUIInfo::UpdatePlayingTag(void)
{
CSingleLock lock(m_critSection);
m_playingEpgTag.reset();
- m_iDuration = recording->GetDuration() * 1000;
+ m_iDuration = recording->GetDuration();
}
}
}
diff --git a/xbmc/pvr/PVRGUIInfo.h b/xbmc/pvr/PVRGUIInfo.h
index 4b7e29bd6b..ab8e7ff53d 100644
--- a/xbmc/pvr/PVRGUIInfo.h
+++ b/xbmc/pvr/PVRGUIInfo.h
@@ -67,15 +67,16 @@ namespace PVR
bool GetSeekTimeLabel(int iSeekSize, std::string &strValue) const;
/*!
- * @brief Get the total duration of the currently playing LiveTV item.
- * @return The total duration in milliseconds or NULL if no channel is playing.
+ * @brief Get the total duration of the currently playing epg event or if no epg is
+ * available the current lenght in seconds of the playing Live TV stream.
+ * @return The total duration in seconds or 0 if no channel is playing.
*/
int GetDuration(void) const;
/*!
* @brief Get the elapsed time since the start of the currently playing epg event or if
- * no epg is available since the start of the playback of a LiveTV item.
- * @return The time in milliseconds or 0 if no channel is playing.
+ * no epg is available since the start of the playback of the current Live TV stream.
+ * @return The time in seconds or 0 if no channel is playing.
*/
int GetElapsedTime(void) const;
diff --git a/xbmc/pvr/PVRManager.h b/xbmc/pvr/PVRManager.h
index 8c95a9c446..3ff9cf8cea 100644
--- a/xbmc/pvr/PVRManager.h
+++ b/xbmc/pvr/PVRManager.h
@@ -397,15 +397,16 @@ namespace PVR
void TriggerSearchMissingChannelIcons(void);
/*!
- * @brief Get the total duration of the currently playing LiveTV item.
- * @return The total duration in milliseconds or NULL if no channel is playing.
+ * @brief Get the total duration of the currently playing epg event or if no epg is
+ * available the current lenght in seconds of the playing Live TV stream.
+ * @return The total duration in seconds or 0 if no channel is playing.
*/
int GetTotalTime(void) const;
/*!
* @brief Get the elapsed time since the start of the currently playing epg event or if
- * no epg is available since the start of the playback of a LiveTV item.
- * @return The time in milliseconds or 0 if no channel is playing.
+ * no epg is available since the start of the playback of the current Live TV stream.
+ * @return The time in seconds or 0 if no channel is playing.
*/
int GetElapsedTime(void) const;