forked from len0rd/rockbox
just pass the struct to vo_setup instead of multiple arguments
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13022 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
c6fce6cad3
commit
4d9c0012d4
3 changed files with 13 additions and 21 deletions
|
@ -879,12 +879,7 @@ static void video_thread(void)
|
|||
continue;
|
||||
|
||||
case STATE_SEQUENCE:
|
||||
vo_setup(info->sequence->display_width,
|
||||
info->sequence->display_height,
|
||||
info->sequence->width,
|
||||
info->sequence->height,
|
||||
info->sequence->chroma_width,
|
||||
info->sequence->chroma_height);
|
||||
vo_setup(info->sequence);
|
||||
mpeg2_skip (mpeg2dec, false);
|
||||
|
||||
break;
|
||||
|
|
|
@ -22,6 +22,4 @@
|
|||
*/
|
||||
|
||||
void vo_draw_frame (uint8_t * const * buf);
|
||||
void vo_setup (unsigned int display_width, unsigned int display_height,
|
||||
unsigned int width, unsigned int height,
|
||||
unsigned int chroma_width, unsigned int chroma_height);
|
||||
void vo_setup (const mpeg2_sequence_t * sequence);
|
||||
|
|
|
@ -213,27 +213,26 @@ void vo_draw_frame (uint8_t * const * buf)
|
|||
#define SCREEN_HEIGHT LCD_WIDTH
|
||||
#endif
|
||||
|
||||
void vo_setup(unsigned int display_width, unsigned int display_height, unsigned int width, unsigned int height,
|
||||
unsigned int chroma_width, unsigned int chroma_height)
|
||||
void vo_setup(const mpeg2_sequence_t * sequence)
|
||||
{
|
||||
image_width=width;
|
||||
image_height=height;
|
||||
image_chroma_x=image_width/chroma_width;
|
||||
image_chroma_y=image_height/chroma_height;
|
||||
image_width=sequence->width;
|
||||
image_height=sequence->height;
|
||||
image_chroma_x=image_width/sequence->chroma_width;
|
||||
image_chroma_y=image_height/sequence->chroma_height;
|
||||
|
||||
if (display_width >= SCREEN_WIDTH) {
|
||||
if (sequence->display_width >= SCREEN_WIDTH) {
|
||||
output_width = SCREEN_WIDTH;
|
||||
output_x = 0;
|
||||
} else {
|
||||
output_width = display_width;
|
||||
output_x = (SCREEN_WIDTH-display_width)/2;
|
||||
output_width = sequence->display_width;
|
||||
output_x = (SCREEN_WIDTH-sequence->display_width)/2;
|
||||
}
|
||||
|
||||
if (display_height >= SCREEN_HEIGHT) {
|
||||
if (sequence->display_height >= SCREEN_HEIGHT) {
|
||||
output_height = SCREEN_HEIGHT;
|
||||
output_y = 0;
|
||||
} else {
|
||||
output_height = display_height;
|
||||
output_y = (SCREEN_HEIGHT-display_height)/2;
|
||||
output_height = sequence->display_height;
|
||||
output_y = (SCREEN_HEIGHT-sequence->display_height)/2;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue