Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide
translations



Rockbox mail archive

Subject: [PATCH] bug fix for elapsed time display

[PATCH] bug fix for elapsed time display

From: Nate Nystrom <nystrom_at_cs.cornell.edu>
Date: Wed, 24 Jul 2002 16:35:20 -0400

Hi,

I've been playing with rockbox for the last few weeks; I'm very
impressed. I started hacking on the source code this past weekend to
fix some of the low-hanging UI problems on the player model (e.g.,
strings longer than 11 chars, displaying information on lines >= 2).
I'm sorry I don't have the time to contribute much more than a patch now
and then.

Anyway, here's a bug fix. The elapsed time was displayed incorrectly
when a track was paused. The time displayed included the time spent in
a pause. Patch below.

Nate


--- orig/firmware/mpeg.c Wed Jul 24 15:57:36 2002
+++ firmware/mpeg.c Wed Jul 24 15:49:59 2002
_at__at_ -147,6 +147,7 _at__at_
 #ifndef SIMULATOR
 static int last_tag = 0;
 static int last_dma_tick = 0;
+static int pause_tick = 0;
 
 #ifndef ARCHOS_RECORDER
 static unsigned int bass_table[] =
_at__at_ -572,6 +573,7 _at__at_
                 DEBUGF("MPEG_PAUSE\n");
                 /* Stop the current stream */
                 playing = false;
+ pause_tick = current_tick;
                 stop_dma();
                 break;
 
_at__at_ -579,6 +581,8 _at__at_
                 DEBUGF("MPEG_RESUME\n");
                 /* Stop the current stream */
                 playing = true;
+ last_dma_tick += current_tick - pause_tick;
+ pause_tick = 0;
                 start_dma();
                 break;
 
Received on 2002-07-24

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy