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



Rockbox mail archive

Subject: [PATCH] ffw/rew & resume fixes
From: Hardeep Sidhu (hardeeps_at_pobox.com)
Date: 2002-08-16


The patch below fixes:
1. ID3 display sometimes disappearing after ffw/rew
2. Set offset after ffw/rew so it resumes at correct location
3. Files not resuming properly when multiple files in buffer before shutdown

Tested on an AJBR6.

-Hardeep

Index: firmware/mpeg.c
===================================================================
RCS file: /cvsroot/rockbox/firmware/mpeg.c,v
retrieving revision 1.93
diff -u -b -r1.93 mpeg.c
--- firmware/mpeg.c 16 Aug 2002 14:41:47 -0000 1.93
+++ firmware/mpeg.c 16 Aug 2002 20:50:33 -0000
@@ -544,7 +544,7 @@
 #pragma interrupt
 void DEI3(void)
 {
- if(playing)
+ if(playing && !paused)
     {
         int unplayed_space_left;
         int space_until_end_of_buffer;
@@ -665,13 +665,15 @@
         }
         else
         {
+ int new_tag_idx = tag_write_idx;
+
             add_track_to_tag_list(trackname);
             /* skip past id3v2 tag (to an even byte) */
             lseek(mpeg_file,
- id3tags[tag_read_idx]->id3.id3v2len & ~1,
+ id3tags[new_tag_idx]->id3.id3v2len & ~1,
                   SEEK_SET);
- id3tags[tag_read_idx]->id3.index = index;
- id3tags[tag_read_idx]->id3.offset = 0;
+ id3tags[new_tag_idx]->id3.index = index;
+ id3tags[new_tag_idx]->id3.offset = 0;
         }
     } while ( mpeg_file < 0 );

@@ -784,11 +786,14 @@
             case MPEG_RESUME:
                 DEBUGF("MPEG_RESUME\n");
                 /* Continue the current stream */
+ paused = false;
+ if (!play_pending)
+ {
                 playing = true;
                 last_dma_tick += current_tick - pause_tick;
                 pause_tick = 0;
- paused = false;
                 start_dma();
+ }
                 break;

             case MPEG_NEXT:
@@ -976,6 +981,7 @@
                     play_pending = true;
                 }

+ id3->offset = newpos;
                 id3->elapsed = newtime;

                 break;



Page was last modified "Jan 10 2012" The Rockbox Crew
aaa