diff options
author | Marcoen Hirschberg <marcoen@gmail.com> | 2007-06-19 21:30:45 +0000 |
---|---|---|
committer | Marcoen Hirschberg <marcoen@gmail.com> | 2007-06-19 21:30:45 +0000 |
commit | 3585ee7a3f5db5d635f5ce9a4a396a4242851da0 (patch) | |
tree | 898ae286890055766c6b83c615fddf71ba6ef8d9 /apps/plugins | |
parent | 95d414542c434043afbba51a566ebe66fc39949c (diff) | |
download | rockbox-3585ee7a3f5db5d635f5ce9a4a396a4242851da0.tar.gz rockbox-3585ee7a3f5db5d635f5ce9a4a396a4242851da0.zip |
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
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/mpegplayer/mpegplayer.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/plugins/mpegplayer/mpegplayer.c b/apps/plugins/mpegplayer/mpegplayer.c index 4618706210..7e18ab4963 100644 --- a/apps/plugins/mpegplayer/mpegplayer.c +++ b/apps/plugins/mpegplayer/mpegplayer.c | |||
@@ -166,6 +166,8 @@ struct plugin_api* rb; | |||
166 | 166 | ||
167 | static mpeg2dec_t * mpeg2dec; | 167 | static mpeg2dec_t * mpeg2dec; |
168 | static int total_offset = 0; | 168 | static int total_offset = 0; |
169 | static int num_drawn = 0; | ||
170 | static int count_start = 0; | ||
169 | 171 | ||
170 | /* Utility */ | 172 | /* Utility */ |
171 | 173 | ||
@@ -906,6 +908,8 @@ static void button_loop(void) | |||
906 | gray_show(false); | 908 | gray_show(false); |
907 | #endif | 909 | #endif |
908 | result = mpeg_menu(); | 910 | result = mpeg_menu(); |
911 | count_start = get_playback_time(); | ||
912 | num_drawn = 0; | ||
909 | 913 | ||
910 | #ifndef HAVE_LCD_COLOR | 914 | #ifndef HAVE_LCD_COLOR |
911 | gray_show(true); | 915 | gray_show(true); |
@@ -1266,7 +1270,6 @@ static void video_thread(void) | |||
1266 | int frame_drop_level = 0; | 1270 | int frame_drop_level = 0; |
1267 | int skip_level = 0; | 1271 | int skip_level = 0; |
1268 | int num_skipped = 0; | 1272 | int num_skipped = 0; |
1269 | int num_drawn = 0; | ||
1270 | /* Used to decide when to display FPS */ | 1273 | /* Used to decide when to display FPS */ |
1271 | unsigned long last_showfps = *rb->current_tick - HZ; | 1274 | unsigned long last_showfps = *rb->current_tick - HZ; |
1272 | /* Used to decide whether or not to force a frame update */ | 1275 | /* Used to decide whether or not to force a frame update */ |
@@ -1568,7 +1571,7 @@ static void video_thread(void) | |||
1568 | /* Calculate and display fps */ | 1571 | /* Calculate and display fps */ |
1569 | if (TIME_AFTER(*rb->current_tick, last_showfps + HZ)) | 1572 | if (TIME_AFTER(*rb->current_tick, last_showfps + HZ)) |
1570 | { | 1573 | { |
1571 | uint32_t clock_ticks = get_playback_time(); | 1574 | uint32_t clock_ticks = get_playback_time() - count_start; |
1572 | int fps = 0; | 1575 | int fps = 0; |
1573 | 1576 | ||
1574 | if (clock_ticks != 0) | 1577 | if (clock_ticks != 0) |