From 3ebe3edfa9310474c6af687ba17fd6e6ac1620fc Mon Sep 17 00:00:00 2001 From: Rainer Hochecker Date: Sat, 9 May 2015 15:25:58 +0200 Subject: [PATCH] dvdplayer: fix calc for frame dropping when going ff --- xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp index d725d329febba..0ee9794259b26 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp @@ -1156,8 +1156,10 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) int bufferLevel; g_renderManager.GetStats(sleepTime, renderPts, bufferLevel); + // estimate the time it will take for the next frame to get rendered + // drop the frame if it's late in regard to this estimation double diff = pts_org - renderPts; - double mindiff = DVD_SEC_TO_TIME(1/m_fFrameRate * m_speed / DVD_PLAYSPEED_NORMAL) * (bufferLevel +1); + double mindiff = DVD_SEC_TO_TIME(1/m_fFrameRate) * (bufferLevel + 1); if (diff < mindiff) { m_droppingStats.AddOutputDropGain(pts, 1/m_fFrameRate);