aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartijn Kaijser <machine.sanctum@gmail.com>2014-12-15 19:24:47 +0100
committerMartijn Kaijser <machine.sanctum@gmail.com>2014-12-15 19:24:47 +0100
commitb39ca17e871658d7e21758be03aa300c3e1acc32 (patch)
tree89d9d6120dc8d909fb5ab41c4915dddd68ddc97f
parent9f830979da4761f1cd9005878d97556aace59db8 (diff)
parentee1bb5735d36d74583cf6007151b0d7e1f10040d (diff)
Merge pull request #5943 from koying/fixamlrotation
FIX: [aml] properly handle rotation
-rw-r--r--xbmc/cores/dvdplayer/DVDCodecs/Video/AMLCodec.cpp24
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();