diff options
author | Rainer Hochecker <fernetmenta@online.de> | 2015-04-13 18:18:59 +0200 |
---|---|---|
committer | Rainer Hochecker <fernetmenta@online.de> | 2015-04-14 12:17:35 +0200 |
commit | 0434895e42a0e5fb9f7cc7db41d680db846b3812 (patch) | |
tree | 10509ea089df9a00f3206b2522700f23d00192b4 | |
parent | e30d85bfa43213736a9dffde3edc748f17043564 (diff) |
dvdplayer audio: fix/improve calculation of playing pts
-rw-r--r-- | xbmc/cores/dvdplayer/DVDAudio.cpp | 14 |
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; } |