diff options
author | Chris "Koying" Browet <cbro@semperpax.com> | 2014-12-14 10:26:40 +0100 |
---|---|---|
committer | Chris "Koying" Browet <cbro@semperpax.com> | 2014-12-14 10:34:45 +0100 |
commit | ee1bb5735d36d74583cf6007151b0d7e1f10040d (patch) | |
tree | b95be5d595487c8bea60cd7673f8e78ac4b48b61 | |
parent | 88f9fb0e3398ffa1ce876e788cbb3a8537127c61 (diff) |
FIX: [aml] properly handle rotation
-rw-r--r-- | xbmc/cores/dvdplayer/DVDCodecs/Video/AMLCodec.cpp | 24 |
1 files 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(); |