diff options
author | Anton Fedchin <afedchin@users.noreply.github.com> | 2015-09-18 19:16:22 +0400 |
---|---|---|
committer | Anton Fedchin <afedchin@users.noreply.github.com> | 2015-09-18 19:16:22 +0400 |
commit | ee71e13f65590b61455465c6523bf28f684749ab (patch) | |
tree | 50aa92e74fa765667af40a45700a20599620a004 | |
parent | 9a67be38f37cff3ad1a2263a141e5f4ae220275c (diff) | |
parent | 6e10c935138d337191805a2494e37d3a44904c04 (diff) |
Merge pull request #8077 from afedchin/Isengard_dxva_rewind_fix
[Isengard] DXVA rewind fix
-rw-r--r-- | xbmc/cores/VideoRenderers/RenderManager.cpp | 5 | ||||
-rw-r--r-- | xbmc/cores/VideoRenderers/RenderManager.h | 2 | ||||
-rw-r--r-- | xbmc/cores/VideoRenderers/WinRenderer.cpp | 4 | ||||
-rw-r--r-- | xbmc/cores/dvdplayer/DVDPlayerVideo.cpp | 19 |
4 files changed, 17 insertions, 13 deletions
diff --git a/xbmc/cores/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoRenderers/RenderManager.cpp index cc6a2f629a..bdef5fe74e 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoRenderers/RenderManager.cpp @@ -1226,11 +1226,12 @@ void CXBMCRenderManager::DiscardBuffer() m_presentevent.notifyAll(); } -bool CXBMCRenderManager::GetStats(double &sleeptime, double &pts, int &bufferLevel) +bool CXBMCRenderManager::GetStats(double &sleeptime, double &pts, int &queued, int &discard) { CSingleLock lock(m_presentlock); sleeptime = m_sleeptime; pts = m_presentpts; - bufferLevel = m_queued.size() + m_discard.size(); + queued = m_queued.size(); + discard = m_discard.size(); return true; } diff --git a/xbmc/cores/VideoRenderers/RenderManager.h b/xbmc/cores/VideoRenderers/RenderManager.h index f43bff1254..8843217e78 100644 --- a/xbmc/cores/VideoRenderers/RenderManager.h +++ b/xbmc/cores/VideoRenderers/RenderManager.h @@ -186,7 +186,7 @@ public: * Can be called by player for lateness detection. This is done best by * looking at the end of the queue. */ - bool GetStats(double &sleeptime, double &pts, int &bufferLevel); + bool GetStats(double &sleeptime, double &pts, int &queued, int &discard); /** * Video player call this on flush in oder to discard any queued frames diff --git a/xbmc/cores/VideoRenderers/WinRenderer.cpp b/xbmc/cores/VideoRenderers/WinRenderer.cpp index 098f55f00f..26cd6c4f71 100644 --- a/xbmc/cores/VideoRenderers/WinRenderer.cpp +++ b/xbmc/cores/VideoRenderers/WinRenderer.cpp @@ -1337,7 +1337,7 @@ CRenderInfo CWinRenderer::GetRenderInfo() CRenderInfo info; info.formats = m_formats; info.max_buffer_size = NUM_BUFFERS; - if (m_format == RENDER_FMT_DXVA && m_processor) + if (m_renderMethod == RENDER_DXVA && m_processor) info.optimal_buffer_size = m_processor->Size(); else info.optimal_buffer_size = 3; @@ -1353,7 +1353,7 @@ void CWinRenderer::ReleaseBuffer(int idx) bool CWinRenderer::NeedBufferForRef(int idx) { // check if processor wants to keep past frames - if (m_format == RENDER_FMT_DXVA && m_processor) + if (m_renderMethod == RENDER_DXVA && m_processor) { DXVABuffer** buffers = (DXVABuffer**)m_VideoBuffers; diff --git a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp index 46fa635618..0fe56c3503 100644 --- a/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayerVideo.cpp @@ -1109,10 +1109,10 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) if (m_speed < 0) { double sleepTime, renderPts; - int bufferLevel; + int queued, discard; double inputPts = m_droppingStats.m_lastPts; - g_renderManager.GetStats(sleepTime, renderPts, bufferLevel); - if (pts_org > renderPts || bufferLevel > 0) + g_renderManager.GetStats(sleepTime, renderPts, queued, discard); + if (pts_org > renderPts || queued > 0) { if (inputPts >= renderPts) { @@ -1131,8 +1131,9 @@ int CDVDPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) else if (m_speed > DVD_PLAYSPEED_NORMAL) { double sleepTime, renderPts; - int bufferLevel; - g_renderManager.GetStats(sleepTime, renderPts, bufferLevel); + int bufferLevel, queued, discard; + g_renderManager.GetStats(sleepTime, renderPts, queued, discard); + bufferLevel = queued + discard; // 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 @@ -1253,10 +1254,10 @@ void CDVDPlayerVideo::ResetFrameRateCalc() double CDVDPlayerVideo::GetCurrentPts() { double iSleepTime, iRenderPts; - int iBufferLevel; + int queued, discard; // get render stats - g_renderManager.GetStats(iSleepTime, iRenderPts, iBufferLevel); + g_renderManager.GetStats(iSleepTime, iRenderPts, queued, discard); if (iRenderPts == DVD_NOPTS_VALUE) return DVD_NOPTS_VALUE; @@ -1366,6 +1367,7 @@ int CDVDPlayerVideo::CalcDropRequirement(double pts, bool updateOnly) bool bNewFrame; int iDroppedPics = -1; int iBufferLevel; + int queued, discard; m_droppingStats.m_lastPts = pts; @@ -1376,7 +1378,8 @@ int CDVDPlayerVideo::CalcDropRequirement(double pts, bool updateOnly) iDecoderPts = pts; // get render stats - g_renderManager.GetStats(iSleepTime, iRenderPts, iBufferLevel); + g_renderManager.GetStats(iSleepTime, iRenderPts, queued, discard); + iBufferLevel = queued + discard; if (iBufferLevel < 0) result |= EOS_BUFFER_LEVEL; |