aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRainer Hochecker <fernetmenta@online.de>2015-04-13 18:18:59 +0200
committerRainer Hochecker <fernetmenta@online.de>2015-04-14 12:17:35 +0200
commit0434895e42a0e5fb9f7cc7db41d680db846b3812 (patch)
tree10509ea089df9a00f3206b2522700f23d00192b4
parente30d85bfa43213736a9dffde3edc748f17043564 (diff)
dvdplayer audio: fix/improve calculation of playing pts
-rw-r--r--xbmc/cores/dvdplayer/DVDAudio.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/xbmc/cores/dvdplayer/DVDAudio.cpp b/xbmc/cores/dvdplayer/DVDAudio.cpp
index a2b1325e05..d1601b1279 100644
--- a/xbmc/cores/dvdplayer/DVDAudio.cpp
+++ b/xbmc/cores/dvdplayer/DVDAudio.cpp
@@ -276,5 +276,17 @@ double CDVDAudio::GetPlayingPts()
if (m_playingPts == DVD_NOPTS_VALUE)
return 0.0;
- return m_playingPts + CDVDClock::GetAbsoluteClock() - m_timeOfPts;
+ double now = CDVDClock::GetAbsoluteClock();
+ double diff = now - m_timeOfPts;
+ double cache = GetCacheTime();
+ double played = 0.0;
+
+ if (diff < cache)
+ played = diff;
+ else
+ played = cache;
+
+ m_timeOfPts = now;
+ m_playingPts += played;
+ return m_playingPts;
}