From ee1bb5735d36d74583cf6007151b0d7e1f10040d Mon Sep 17 00:00:00 2001 From: "Chris \"Koying\" Browet" Date: Sun, 14 Dec 2014 10:26:40 +0100 Subject: FIX: [aml] properly handle rotation --- xbmc/cores/dvdplayer/DVDCodecs/Video/AMLCodec.cpp | 24 +++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/AMLCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/AMLCodec.cpp index 47f6594c6f..a45be9899b 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/AMLCodec.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/AMLCodec.cpp @@ -2182,9 +2182,26 @@ void CAMLCodec::SetVideoRect(const CRect &SrcRect, const CRect &DestRect) } // dest_rect - if (m_dst_rect != DestRect) + CRect dst_rect = DestRect; + // handle orientation + switch (am_private->video_rotation_degree) + { + case 0: + case 2: + break; + + case 1: + case 3: + { + int diff = (int) ((dst_rect.Height() - dst_rect.Width()) / 2); + dst_rect = CRect(DestRect.x1 - diff, DestRect.y1, DestRect.x2 + diff, DestRect.y2); + } + + } + + if (m_dst_rect != dst_rect) { - m_dst_rect = DestRect; + m_dst_rect = dst_rect; update = true; } @@ -2195,7 +2212,7 @@ void CAMLCodec::SetVideoRect(const CRect &SrcRect, const CRect &DestRect) return; } - CRect gui, display, dst_rect; + CRect gui, display; gui = CRect(0, 0, CDisplaySettings::Get().GetCurrentResolutionInfo().iWidth, CDisplaySettings::Get().GetCurrentResolutionInfo().iHeight); #ifdef TARGET_ANDROID @@ -2203,7 +2220,6 @@ void CAMLCodec::SetVideoRect(const CRect &SrcRect, const CRect &DestRect) #else display = gui; #endif - dst_rect = m_dst_rect; if (gui != display) { float xscale = display.Width() / gui.Width(); -- cgit v1.2.3