avoid division by zero (appears in the sim at times)

fixed dynamicly updated scrolling lines


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3177 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Daniel Stenberg 2003-01-28 17:00:49 +00:00
parent bb3685edd8
commit d5934e09a4

View file

@ -666,9 +666,11 @@ bool wps_refresh(struct mp3entry* id3, int ffwd_offset, unsigned char refresh_mo
/* progress */ /* progress */
if (flags & refresh_mode & WPS_REFRESH_PLAYER_PROGRESS) { if (flags & refresh_mode & WPS_REFRESH_PLAYER_PROGRESS) {
int offset = global_settings.statusbar ? STATUSBAR_HEIGHT : 0; int offset = global_settings.statusbar ? STATUSBAR_HEIGHT : 0;
int percent=
id3->length?
(id3->elapsed + ff_rewind_count) * 100 / id3->length:0;
slidebar(0, i*h + offset + 1, LCD_WIDTH, 6, slidebar(0, i*h + offset + 1, LCD_WIDTH, 6,
(id3->elapsed + ff_rewind_count) * 100 / id3->length, percent, Grow_Right);
Grow_Right);
update_line = true; update_line = true;
} }
if (flags & refresh_mode & WPS_REFRESH_PEAK_METER) { if (flags & refresh_mode & WPS_REFRESH_PEAK_METER) {
@ -702,7 +704,6 @@ bool wps_refresh(struct mp3entry* id3, int ffwd_offset, unsigned char refresh_mo
if (refresh_mode & WPS_REFRESH_SCROLL) { if (refresh_mode & WPS_REFRESH_SCROLL) {
lcd_puts_scroll(0, i, buf); lcd_puts_scroll(0, i, buf);
} }
flags=0;
} }
/* dynamic / static line */ /* dynamic / static line */