diff options
Diffstat (limited to 'apps/plugins/mpegplayer/video_out_rockbox.c')
-rw-r--r-- | apps/plugins/mpegplayer/video_out_rockbox.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/apps/plugins/mpegplayer/video_out_rockbox.c b/apps/plugins/mpegplayer/video_out_rockbox.c index a5fdf5efbb..c77c433dee 100644 --- a/apps/plugins/mpegplayer/video_out_rockbox.c +++ b/apps/plugins/mpegplayer/video_out_rockbox.c @@ -30,7 +30,8 @@ extern struct plugin_api* rb; #include "mpeg2.h" #include "video_out.h" -static int starttick; +static int starttick = 0; +static int lasttick = 0; #define CSUB_X 2 #define CSUB_Y 2 @@ -211,19 +212,23 @@ static void rockbox_draw_frame (vo_instance_t * instance, rb->lcd_update_rect(output_x,output_y,output_width,output_height); #endif - if (starttick==0) starttick=*rb->current_tick-1; /* Avoid divby0 */ + if (starttick==0) { + starttick=*rb->current_tick-1; /* Avoid divby0 */ + lasttick=starttick; + } /* Calculate fps */ - frame++; - if ((frame % 125) == 0) { + if (*rb->current_tick-lasttick>=2*HZ) { ticks=(*rb->current_tick)-starttick; fps=(frame*1000)/ticks; rb->snprintf(str,sizeof(str),"%d.%d",(fps/10),fps%10); rb->lcd_putsxy(0,0,str); - rb->lcd_update_rect(0,0,80,8); + + lasttick+=2*HZ; } + frame++; } vo_instance_t static_instance; |