Skip to content

Commit

Permalink
FIX: [amcs] Adjust surface rect only when really necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
koying committed May 26, 2017
1 parent cb22ff5 commit e1abfb6
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -333,15 +333,21 @@ void CDVDMediaCodecInfo::RenderUpdate(const CRect &SrcRect, const CRect &DestRec
if (!m_valid)
return;

if (DestRect != m_videoview->getSurfaceRect())
CRect surfRect = m_videoview->getSurfaceRect();
if (DestRect != surfRect)
{
CRect adjRect = CXBMCApp::MapRenderToDroid(DestRect);
m_videoview->setSurfaceRect(adjRect);
CLog::Log(LOGDEBUG, "RenderUpdate: Dest - %f+%f-%fx%f", DestRect.x1, DestRect.y1, DestRect.Width(), DestRect.Height());
CLog::Log(LOGDEBUG, "RenderUpdate: Adj - %f+%f-%fx%f", adjRect.x1, adjRect.y1, adjRect.Width(), adjRect.Height());
if (adjRect != surfRect)
{
m_videoview->setSurfaceRect(adjRect);
CLog::Log(LOGDEBUG, "RenderUpdate: Dest - %f+%f-%fx%f", DestRect.x1, DestRect.y1, DestRect.Width(), DestRect.Height());
CLog::Log(LOGDEBUG, "RenderUpdate: Adj - %f+%f-%fx%f", adjRect.x1, adjRect.y1, adjRect.Width(), adjRect.Height());

// setVideoViewSurfaceRect is async, so skip rendering this frame
ReleaseOutputBuffer(false);
// setVideoViewSurfaceRect is async, so skip rendering this frame
ReleaseOutputBuffer(false);
}
else
ReleaseOutputBuffer(true);
}
else
ReleaseOutputBuffer(true);
Expand Down

0 comments on commit e1abfb6

Please sign in to comment.