Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

player: debug logs and some cleanup

  • Loading branch information...
commit 367f3b7402d29b04eabf161fb83d2c4c80159b93 1 parent 0ce26e0
@FernetMenta authored
View
17 xbmc/cores/VideoRenderers/RenderManager.cpp
@@ -962,6 +962,16 @@ void CXBMCRenderManager::PrepareNextRender()
m_sleeptime = presenttime - clocktime;
+// double interval;
+// if (g_VideoReferenceClock.GetRefreshRate(&interval) > 0)
+// {
+// if (m_swaptime > interval * 0.7)
+// {
+// presenttime += interval;
+// CLog::Log(LOGDEBUG,"------------ very long swaptime");
+// }
+// }
+
if (g_graphicsContext.IsFullScreenVideo() || presenttime <= clocktime+0.01)
{
m_presentPts = m_renderBuffers[idx].pts;
@@ -998,9 +1008,12 @@ void CXBMCRenderManager::NotifyDisplayFlip()
// if (g_graphicsContext.IsFullScreenVideo())
// {
// uint64_t diff = CurrentHostCounter() - m_rendertime;
+// m_swaptime = ((double)(diff))/CurrentHostFrequency();
// int waittime = (int)((diff*1000LL)/CurrentHostFrequency());
-// if (waittime > 5)
-// CLog::Log(LOGNOTICE,"------------------ wait swap buffers: %d", waittime);
+// if (waittime > 15)
+// {
+// CLog::Log(LOGNOTICE,"------------------ wait swap buffers: %f, sleep: %f", m_swaptime, m_sleeptime);
+// }
// }
int last = m_iDisplayedRenderBuffer;
View
1  xbmc/cores/VideoRenderers/RenderManager.h
@@ -285,6 +285,7 @@ class CXBMCRenderManager
CEvent m_flushEvent;
CDVDClock *m_pClock;
uint64_t m_rendertime;
+ double m_swaptime;
unsigned int m_swapCount;
OVERLAY::CRenderer m_overlays;
View
16 xbmc/cores/dvdplayer/DVDPlayerVideo.cpp
@@ -491,7 +491,7 @@ void CDVDPlayerVideo::Process()
}
bRequestDrop = false;
- iDropDirective = CalcDropRequirement(pts, frametime,0);
+ iDropDirective = CalcDropRequirement(pts);
if (iDropDirective & EOS_LATE)
{
if (m_bAllowDrop)
@@ -1253,6 +1253,7 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts)
{
m_droppingStats.AddOutputDropGain(pts, 1/m_fFrameRate);
m_droppingStats.m_requestOutputDrop = false;
+ CLog::Log(LOGDEBUG,"%s - dropped in output", __FUNCTION__);
return result | EOS_DROPPED;
}
@@ -1633,7 +1634,7 @@ void CDVDPlayerVideo::CalcFrameRate()
}
}
-int CDVDPlayerVideo::CalcDropRequirement(double pts, double frametime, double repeatPic)
+int CDVDPlayerVideo::CalcDropRequirement(double pts)
{
int result = 0;
double iSleepTime;
@@ -1656,7 +1657,7 @@ int CDVDPlayerVideo::CalcDropRequirement(double pts, double frametime, double re
if (iBufferLevel < 2)
{
result |= EOS_BUFFER_LEVEL;
-// CLog::Log(LOGNOTICE,"--------------------- hurry: %d", iBufferLevel);
+ CLog::Log(LOGNOTICE,"--------------------- hurry: %d", iBufferLevel);
}
bNewFrame = iDecoderPts != m_droppingStats.m_lastDecoderPts;
@@ -1667,7 +1668,10 @@ int CDVDPlayerVideo::CalcDropRequirement(double pts, double frametime, double re
iInterval = 1/m_fFrameRate*(double)DVD_TIME_BASE;
// add any gains regardless of being late
- if (m_droppingStats.m_lastDecoderPts > 0 && bNewFrame && m_bAllowDrop)
+ if (m_droppingStats.m_lastDecoderPts > 0
+ && bNewFrame
+ && m_bAllowDrop
+ && m_droppingStats.m_dropRequests > 0)
{
iGain = (iDecoderPts - m_droppingStats.m_lastDecoderPts - iInterval)/(double)DVD_TIME_BASE;
if (iSkippedDeint)
@@ -1679,7 +1683,7 @@ int CDVDPlayerVideo::CalcDropRequirement(double pts, double frametime, double re
m_droppingStats.m_totalGain += gain.gain;
result |= EOS_DROPPED;
m_droppingStats.m_dropRequests = 0;
- CLog::Log(LOGNOTICE,"-------- dropped de-interlacing cycle");
+ CLog::Log(LOGDEBUG,"CDVDPlayerVideo::CalcDropRequirement - dropped de-interlacing cycle, Sleeptime: %f, Bufferlevel: %d", iSleepTime, iBufferLevel);
}
else if (iGain > 1/m_fFrameRate)
{
@@ -1690,7 +1694,7 @@ int CDVDPlayerVideo::CalcDropRequirement(double pts, double frametime, double re
m_droppingStats.m_totalGain += iGain;
result |= EOS_DROPPED;
m_droppingStats.m_dropRequests = 0;
- CLog::Log(LOGNOTICE,"-------- dropped in decoder, gain: %f, interval: %f, pts: %f, frametime: %f", iGain, iInterval, iDecoderPts, 1/m_fFrameRate);
+ CLog::Log(LOGDEBUG,"CDVDPlayerVideo::CalcDropRequirement - dropped in decoder, Sleeptime: %f, Bufferlevel: %d, Gain: %f", iSleepTime, iBufferLevel, iGain);
}
}
View
2  xbmc/cores/dvdplayer/DVDPlayerVideo.h
@@ -156,7 +156,7 @@ class CDVDPlayerVideo : public CThread
void ResetFrameRateCalc();
void CalcFrameRate();
- int CalcDropRequirement(double pts, double frametime, double repeatPic);
+ int CalcDropRequirement(double pts);
double m_fFrameRate; //framerate of the video currently playing
bool m_bCalcFrameRate; //if we should calculate the framerate from the timestamps
Please sign in to comment.
Something went wrong with that request. Please try again.