summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorMarcoen Hirschberg <marcoen@gmail.com>2006-12-30 10:44:00 +0000
committerMarcoen Hirschberg <marcoen@gmail.com>2006-12-30 10:44:00 +0000
commitd09efac0f21d388dd345e890ac02d5e5dee7e69e (patch)
tree7858b0f6d4f8d62049fa724f5174940841caac65 /apps
parentd3f50ed3963cab15a969000241a9b00cd6d5c618 (diff)
assume the YUV code rotates on portrait screens
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11864 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/mpegplayer/video_out_rockbox.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/apps/plugins/mpegplayer/video_out_rockbox.c b/apps/plugins/mpegplayer/video_out_rockbox.c
index 38a76a7747..f6e33e9d97 100644
--- a/apps/plugins/mpegplayer/video_out_rockbox.c
+++ b/apps/plugins/mpegplayer/video_out_rockbox.c
@@ -199,6 +199,14 @@ void vo_draw_frame (uint8_t * const * buf)
#endif
}
+#if LCD_WIDTH >= LCD_HEIGHT
+#define SCREEN_WIDTH LCD_WIDTH
+#define SCREEN_HEIGHT LCD_HEIGHT
+#else /* Assume the screen is rotates on portraid LCDs */
+#define SCREEN_WIDTH LCD_HEIGHT
+#define SCREEN_HEIGHT LCD_WIDTH
+#endif
+
void vo_setup(unsigned int width, unsigned int height,
unsigned int chroma_width, unsigned int chroma_height)
{
@@ -207,19 +215,19 @@ void vo_setup(unsigned int width, unsigned int height,
image_chroma_x=image_width/chroma_width;
image_chroma_y=image_height/chroma_height;
- if (image_width >= LCD_WIDTH) {
- output_width = LCD_WIDTH;
+ if (image_width >= SCREEN_WIDTH) {
+ output_width = SCREEN_WIDTH;
output_x = 0;
} else {
output_width = image_width;
- output_x = (LCD_WIDTH-image_width)/2;
+ output_x = (SCREEN_WIDTH-image_width)/2;
}
- if (image_height >= LCD_HEIGHT) {
- output_height = LCD_HEIGHT;
+ if (image_height >= SCREEN_HEIGHT) {
+ output_height = SCREEN_HEIGHT;
output_y = 0;
} else {
output_height = image_height;
- output_y = (LCD_HEIGHT-image_height)/2;
+ output_y = (SCREEN_HEIGHT-image_height)/2;
}
}