aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRainer Hochecker <fernetmenta@online.de>2014-11-23 21:44:28 +0100
committerRainer Hochecker <fernetmenta@online.de>2014-11-23 21:44:28 +0100
commit179d3155ef440b08c3a1dcda79b32bc342fb4e5d (patch)
treeb4189cd87deb8bb5a9d772ae6bce29dbc2585199
parente50472c6cb8e5b24ae6a65ff85e1d66d87ee4e4e (diff)
parentb5e0a988b971e8a1cbe0228cdd8013c3aff635ed (diff)
Merge pull request #5776 from FernetMenta/pts
dvdplayer: update dropping stats after every call to decode
-rw-r--r--xbmc/cores/dvdplayer/DVDPlayerVideo.cpp10
-rw-r--r--xbmc/cores/dvdplayer/DVDPlayerVideo.h2
2 files changed, 9 insertions, 3 deletions
diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp
index e47f85c773..f030e37282 100644
--- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp
+++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp
@@ -512,7 +512,7 @@ void CDVDPlayerVideo::Process()
}
bRequestDrop = false;
- iDropDirective = CalcDropRequirement(pts);
+ iDropDirective = CalcDropRequirement(pts, false);
if (iDropDirective & EOS_VERYLATE)
{
if (m_bAllowDrop)
@@ -748,6 +748,9 @@ void CDVDPlayerVideo::Process()
if (iDecoderState & VC_BUFFER)
break;
+ // update dropping stats
+ CalcDropRequirement(pts, true);
+
// the decoder didn't need more data, flush the remaning buffer
iDecoderState = m_pVideoCodec->Decode(NULL, 0, DVD_NOPTS_VALUE, DVD_NOPTS_VALUE);
}
@@ -1554,7 +1557,7 @@ void CDVDPlayerVideo::CalcFrameRate()
}
}
-int CDVDPlayerVideo::CalcDropRequirement(double pts)
+int CDVDPlayerVideo::CalcDropRequirement(double pts, bool updateOnly)
{
int result = 0;
double iSleepTime;
@@ -1622,6 +1625,9 @@ int CDVDPlayerVideo::CalcDropRequirement(double pts)
}
m_droppingStats.m_lastDecoderPts = iDecoderPts;
+ if (updateOnly)
+ return result;
+
// subtract gains
while (!m_droppingStats.m_gain.empty() &&
iRenderPts >= m_droppingStats.m_gain.front().pts)
diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.h b/xbmc/cores/dvdplayer/DVDPlayerVideo.h
index 4e1b3d6d36..489ebfc95a 100644
--- a/xbmc/cores/dvdplayer/DVDPlayerVideo.h
+++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.h
@@ -149,7 +149,7 @@ protected:
void ResetFrameRateCalc();
void CalcFrameRate();
- int CalcDropRequirement(double pts);
+ int CalcDropRequirement(double pts, bool updateOnly);
double m_fFrameRate; //framerate of the video currently playing
bool m_bCalcFrameRate; //if we should calculate the framerate from the timestamps