From d09efac0f21d388dd345e890ac02d5e5dee7e69e Mon Sep 17 00:00:00 2001 From: Marcoen Hirschberg Date: Sat, 30 Dec 2006 10:44:00 +0000 Subject: [PATCH] assume the YUV code rotates on portrait screens git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11864 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/mpegplayer/video_out_rockbox.c | 20 ++++++++++++++------ 1 file 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; } }