diff options
| author | Linus Nielsen Feltzing <linus@haxx.se> | 2003-02-14 02:48:12 +0000 |
|---|---|---|
| committer | Linus Nielsen Feltzing <linus@haxx.se> | 2003-02-14 02:48:12 +0000 |
| commit | 1fcd31d3ff0e8f2acf2351252b836239cc78a670 (patch) | |
| tree | 7a710721c05da96f3342d699376adaaf06985f81 /firmware/mpeg.c | |
| parent | ebe0752469021dfb09f2fb2b0752e192833e9f23 (diff) | |
| download | rockbox-1fcd31d3ff0e8f2acf2351252b836239cc78a670.zip rockbox-1fcd31d3ff0e8f2acf2351252b836239cc78a670.tar.gz rockbox-1fcd31d3ff0e8f2acf2351252b836239cc78a670.tar.bz2 rockbox-1fcd31d3ff0e8f2acf2351252b836239cc78a670.tar.xz | |
Fixed the 3-hour time display bug, plus some cosmetic changes
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3253 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/mpeg.c')
| -rw-r--r-- | firmware/mpeg.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/firmware/mpeg.c b/firmware/mpeg.c index d86b51f..0518dd2 100644 --- a/firmware/mpeg.c +++ b/firmware/mpeg.c @@ -482,8 +482,8 @@ static int lowest_watermark_level; /* Debug value to observe the buffer #ifdef HAVE_MAS3587F static bool is_recording; /* We are recording */ static bool stop_pending; -unsigned long record_start_frame; /* Frame number where - recording started */ +unsigned long record_start_time; /* Value of current_tick when recording + was started */ static bool saving; /* We are saving the buffer to disk */ #endif @@ -2133,7 +2133,6 @@ static void init_playback(void) void mpeg_record(char *filename) { num_rec_bytes = 0; - is_recording = true; queue_post(&mpeg_queue, MPEG_RECORD, (void*)filename); } @@ -2155,9 +2154,10 @@ static void start_recording(void) sleep(20); - /* Read the current frame */ - mas_readmem(MAS_BANK_D0, 0xfd0, &record_start_frame, 1); + /* Store the current time */ + record_start_time = current_tick; + is_recording = true; stop_pending = false; saving = false; } @@ -2182,21 +2182,12 @@ static void stop_recording(void) drain_dma_buffer(); } -unsigned long mpeg_num_recorded_frames(void) +unsigned long mpeg_recorded_time(void) { - unsigned long val; - if(is_recording) - { - /* Read the current frame */ - mas_readmem(MAS_BANK_D0, 0xfd0, &val, 1); - - return val - record_start_frame; - } + return current_tick - record_start_time; else - { return 0; - } } unsigned long mpeg_num_recorded_bytes(void) |