diff options
author | Rainer Hochecker <fernetmenta@online.de> | 2016-04-12 07:23:54 +0200 |
---|---|---|
committer | Rainer Hochecker <fernetmenta@online.de> | 2016-04-12 07:23:54 +0200 |
commit | 515bf94b0a4d7370ad140f5e53af59cbe03cf48d (patch) | |
tree | 39cae4ad9387822fbe262e3e3c803db46ac16c78 | |
parent | ffa8a08226afabe855f5c68e3dd4682f5391c350 (diff) | |
parent | dc836639c16b003f750a892626ac276392b256cb (diff) |
Merge pull request #9604 from FernetMenta/macro
VideoPlayer: fix frame dropping
-rw-r--r-- | xbmc/cores/VideoPlayer/DVDClock.h | 1 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/VideoPlayer.cpp | 4 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp | 10 | ||||
-rw-r--r-- | xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp | 2 |
4 files changed, 8 insertions, 9 deletions
diff --git a/xbmc/cores/VideoPlayer/DVDClock.h b/xbmc/cores/VideoPlayer/DVDClock.h index fbdb89925a..6357b7007d 100644 --- a/xbmc/cores/VideoPlayer/DVDClock.h +++ b/xbmc/cores/VideoPlayer/DVDClock.h @@ -28,7 +28,6 @@ #define DVD_TIME_BASE 1000000 #define DVD_NOPTS_VALUE 0xFFF0000000000000 -#define DVD_TIME_TO_SEC(x) ((int)((double)(x) / DVD_TIME_BASE)) #define DVD_TIME_TO_MSEC(x) ((int)((double)(x) * 1000 / DVD_TIME_BASE)) #define DVD_SEC_TO_TIME(x) ((double)(x) * DVD_TIME_BASE) #define DVD_MSEC_TO_TIME(x) ((double)(x) * DVD_TIME_BASE / 1000) diff --git a/xbmc/cores/VideoPlayer/VideoPlayer.cpp b/xbmc/cores/VideoPlayer/VideoPlayer.cpp index ad94e625d4..c0434fa501 100644 --- a/xbmc/cores/VideoPlayer/VideoPlayer.cpp +++ b/xbmc/cores/VideoPlayer/VideoPlayer.cpp @@ -3158,7 +3158,7 @@ void CVideoPlayer::GetGeneralInfo(std::string& strGeneralInfo) , StringUtils::SizeToString(m_State.cache_bytes).c_str() , m_State.cache_level * 100); if(m_playSpeed == 0 || m_caching == CACHESTATE_FULL) - strBuf += StringUtils::Format(" %d sec", DVD_TIME_TO_SEC(m_State.cache_delay)); + strBuf += StringUtils::Format(" %d msec", DVD_TIME_TO_MSEC(m_State.cache_delay)); } strGeneralInfo = StringUtils::Format("C( a/v:% 6.3f%s, %s amp:% 5.2f )" @@ -3184,7 +3184,7 @@ void CVideoPlayer::GetGeneralInfo(std::string& strGeneralInfo) , StringUtils::SizeToString(m_State.cache_bytes).c_str() , m_State.cache_level * 100); if(m_playSpeed == 0 || m_caching == CACHESTATE_FULL) - strBuf += StringUtils::Format(" %d sec", DVD_TIME_TO_SEC(m_State.cache_delay)); + strBuf += StringUtils::Format(" %d msec", DVD_TIME_TO_MSEC(m_State.cache_delay)); } strGeneralInfo = StringUtils::Format("Player: a/v:% 6.3f, %s" diff --git a/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp b/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp index cff3b8b602..da1e0e0763 100644 --- a/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp +++ b/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp @@ -934,7 +934,7 @@ double CVideoPlayerVideo::GetCurrentPts() return DVD_NOPTS_VALUE; else if (m_speed == DVD_PLAYSPEED_NORMAL) { - iRenderPts -= std::max(0.0, DVD_SEC_TO_TIME(iSleepTime)); + iRenderPts -= std::max(0.0, iSleepTime); if (iRenderPts < 0) iRenderPts = 0; @@ -1065,7 +1065,7 @@ int CVideoPlayerVideo::CalcDropRequirement(double pts) { if (iSkippedPicture > 0) { - iGain = iSkippedPicture*interval/(double)DVD_TIME_BASE; + iGain = iSkippedPicture*interval; CDroppingStats::CGain gain; gain.gain = iGain; gain.pts = iDecoderPts; @@ -1074,11 +1074,11 @@ int CVideoPlayerVideo::CalcDropRequirement(double pts) result |= EOS_DROPPED; m_droppingStats.m_dropRequests = 0; if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG,"CVideoPlayerVideo::CalcDropRequirement - dropped pictures, Sleeptime: %f, Bufferlevel: %d, Gain: %f", iSleepTime, iBufferLevel, iGain); + CLog::Log(LOGDEBUG,"CVideoPlayerVideo::CalcDropRequirement - dropped pictures, Sleeptime: %d, Bufferlevel: %d, Gain: %d", DVD_TIME_TO_MSEC(iSleepTime), iBufferLevel, DVD_TIME_TO_MSEC(iGain)); } if (iDroppedFrames > 0) { - iGain = iDroppedFrames*interval/(double)DVD_TIME_BASE; + iGain = iDroppedFrames*interval; CDroppingStats::CGain gain; gain.gain = iGain; gain.pts = iDecoderPts; @@ -1087,7 +1087,7 @@ int CVideoPlayerVideo::CalcDropRequirement(double pts) result |= EOS_DROPPED; m_droppingStats.m_dropRequests = 0; if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG,"CVideoPlayerVideo::CalcDropRequirement - dropped in decoder, Sleeptime: %f, Bufferlevel: %d, Gain: %f", iSleepTime, iBufferLevel, iGain); + CLog::Log(LOGDEBUG,"CVideoPlayerVideo::CalcDropRequirement - dropped in decoder, Sleeptime: %d, Bufferlevel: %d, Gain: %d", DVD_TIME_TO_MSEC(iSleepTime), iBufferLevel, DVD_TIME_TO_MSEC(iGain)); } } diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp index b1701d4eef..3c0864c6ff 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp @@ -1362,7 +1362,7 @@ void CRenderManager::DiscardBuffer() bool CRenderManager::GetStats(double &sleeptime, double &pts, int &queued, int &discard) { CSingleLock lock(m_presentlock); - sleeptime = DVD_TIME_TO_SEC(m_sleeptime); + sleeptime = m_sleeptime; pts = m_presentpts; queued = m_queued.size(); discard = m_discard.size(); |