forked from len0rd/rockbox
change the fps calculation so setting changes are visible without delay
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13678 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
95d414542c
commit
3585ee7a3f
1 changed files with 5 additions and 2 deletions
|
|
@ -166,6 +166,8 @@ struct plugin_api* rb;
|
||||||
|
|
||||||
static mpeg2dec_t * mpeg2dec;
|
static mpeg2dec_t * mpeg2dec;
|
||||||
static int total_offset = 0;
|
static int total_offset = 0;
|
||||||
|
static int num_drawn = 0;
|
||||||
|
static int count_start = 0;
|
||||||
|
|
||||||
/* Utility */
|
/* Utility */
|
||||||
|
|
||||||
|
|
@ -906,6 +908,8 @@ static void button_loop(void)
|
||||||
gray_show(false);
|
gray_show(false);
|
||||||
#endif
|
#endif
|
||||||
result = mpeg_menu();
|
result = mpeg_menu();
|
||||||
|
count_start = get_playback_time();
|
||||||
|
num_drawn = 0;
|
||||||
|
|
||||||
#ifndef HAVE_LCD_COLOR
|
#ifndef HAVE_LCD_COLOR
|
||||||
gray_show(true);
|
gray_show(true);
|
||||||
|
|
@ -1266,7 +1270,6 @@ static void video_thread(void)
|
||||||
int frame_drop_level = 0;
|
int frame_drop_level = 0;
|
||||||
int skip_level = 0;
|
int skip_level = 0;
|
||||||
int num_skipped = 0;
|
int num_skipped = 0;
|
||||||
int num_drawn = 0;
|
|
||||||
/* Used to decide when to display FPS */
|
/* Used to decide when to display FPS */
|
||||||
unsigned long last_showfps = *rb->current_tick - HZ;
|
unsigned long last_showfps = *rb->current_tick - HZ;
|
||||||
/* Used to decide whether or not to force a frame update */
|
/* Used to decide whether or not to force a frame update */
|
||||||
|
|
@ -1568,7 +1571,7 @@ static void video_thread(void)
|
||||||
/* Calculate and display fps */
|
/* Calculate and display fps */
|
||||||
if (TIME_AFTER(*rb->current_tick, last_showfps + HZ))
|
if (TIME_AFTER(*rb->current_tick, last_showfps + HZ))
|
||||||
{
|
{
|
||||||
uint32_t clock_ticks = get_playback_time();
|
uint32_t clock_ticks = get_playback_time() - count_start;
|
||||||
int fps = 0;
|
int fps = 0;
|
||||||
|
|
||||||
if (clock_ticks != 0)
|
if (clock_ticks != 0)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue