summaryrefslogtreecommitdiff
path: root/apps/plugins/mpegplayer
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/mpegplayer')
-rw-r--r--apps/plugins/mpegplayer/video_out_rockbox.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/apps/plugins/mpegplayer/video_out_rockbox.c b/apps/plugins/mpegplayer/video_out_rockbox.c
index 786d9d0e14..a5fdf5efbb 100644
--- a/apps/plugins/mpegplayer/video_out_rockbox.c
+++ b/apps/plugins/mpegplayer/video_out_rockbox.c
@@ -35,12 +35,14 @@ static int starttick;
35#define CSUB_X 2 35#define CSUB_X 2
36#define CSUB_Y 2 36#define CSUB_Y 2
37 37
38static int image_x;
39static int image_y;
40static int image_width; 38static int image_width;
41static int image_height; 39static int image_height;
42static int image_chroma_x; 40static int image_chroma_x;
43static int image_chroma_y; 41static int image_chroma_y;
42static int output_x;
43static int output_y;
44static int output_width;
45static int output_height;
44 46
45#if (LCD_DEPTH == 16) && \ 47#if (LCD_DEPTH == 16) && \
46 ((LCD_PIXELFORMAT == RGB565) || (LCD_PIXELFORMAT == RGB565SWAPPED)) 48 ((LCD_PIXELFORMAT == RGB565) || (LCD_PIXELFORMAT == RGB565SWAPPED))
@@ -197,16 +199,16 @@ static void rockbox_draw_frame (vo_instance_t * instance,
197 (void)id; 199 (void)id;
198 (void)instance; 200 (void)instance;
199 201
200#if (CONFIG_LCD == LCD_IPODCOLOR || CONFIG_LCD == LCD_IPODNANO) && \ 202#if (CONFIG_LCD == LCD_IPODCOLOR || CONFIG_LCD == LCD_IPODNANO \
201 !defined(SIMULATOR) 203 || CONFIG_LCD == LCD_H300) && !defined(SIMULATOR)
202 rb->lcd_yuv_blit(buf, 204 rb->lcd_yuv_blit(buf,
203 0,0,image_width, 205 0,0,image_width,
204 image_x,image_y,image_width,image_height); 206 output_x,output_y,output_width,output_height);
205#elif (LCD_DEPTH == 16) && \ 207#elif (LCD_DEPTH == 16) && \
206 ((LCD_PIXELFORMAT == RGB565) || (LCD_PIXELFORMAT == RGB565SWAPPED)) 208 ((LCD_PIXELFORMAT == RGB565) || (LCD_PIXELFORMAT == RGB565SWAPPED))
207 yuv_bitmap_part(buf,0,0,image_width, 209 yuv_bitmap_part(buf,0,0,image_width,
208 image_x,image_y,image_width,image_height); 210 output_x,output_y,output_width,output_height);
209 rb->lcd_update_rect(image_x,image_y,image_width,image_height); 211 rb->lcd_update_rect(output_x,output_y,output_width,output_height);
210#endif 212#endif
211 213
212 if (starttick==0) starttick=*rb->current_tick-1; /* Avoid divby0 */ 214 if (starttick==0) starttick=*rb->current_tick-1; /* Avoid divby0 */
@@ -265,15 +267,19 @@ static int rockbox_setup (vo_instance_t * instance, unsigned int width,
265 image_chroma_y=image_height/chroma_height; 267 image_chroma_y=image_height/chroma_height;
266 268
267 if (image_width >= LCD_WIDTH) { 269 if (image_width >= LCD_WIDTH) {
268 image_x = 0; 270 output_width = LCD_WIDTH;
271 output_x = 0;
269 } else { 272 } else {
270 image_x = (LCD_WIDTH-image_width)/2; 273 output_width = image_width;
274 output_x = (LCD_WIDTH-image_width)/2;
271 } 275 }
272 276
273 if (image_height >= LCD_HEIGHT) { 277 if (image_height >= LCD_HEIGHT) {
274 image_y = 0; 278 output_height = LCD_HEIGHT;
279 output_y = 0;
275 } else { 280 } else {
276 image_y = (LCD_HEIGHT-image_height)/2; 281 output_height = image_height;
282 output_y = (LCD_HEIGHT-image_height)/2;
277 } 283 }
278 284
279 return 0; 285 return 0;