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: Re: Track change silence

Re: Track change silence

From: Hardeep Sidhu <hardeeps_at_pobox.com>
Date: Wed, 21 Aug 2002 20:59:38 -0700

The patch below fixes this bug. The problem occurred when selecting the next track
just as it was being loaded into the buffer. The patch also fixes the bug where
the first few seconds of the next track were repeated if it was already loaded in
memory.

-Hardeep

Index: firmware//mpeg.c
===================================================================
RCS file: /cvsroot/rockbox/firmware/mpeg.c,v
retrieving revision 1.98
diff -u -b -r1.98 mpeg.c
--- firmware//mpeg.c 21 Aug 2002 17:38:56 -0000 1.98
+++ firmware//mpeg.c 22 Aug 2002 03:06:16 -0000
_at__at_ -790,23 +790,33 _at__at_

                 /* is next track in ram? */
                 if ( num_tracks_in_memory() > 1 ) {
- int track_offset = (tag_read_idx+1) & MAX_ID3_TAGS_MASK;
- mp3buf_read = id3tags[track_offset]->mempos;
+ int unplayed_space_left, unswapped_space_left;
+
+ track_change();
+ mp3buf_read = id3tags[tag_read_idx]->mempos;
                     init_dma();
                     last_dma_tick = current_tick;

+ unplayed_space_left = get_unplayed_space();
+ unswapped_space_left = mp3buf_write - mp3buf_swapwrite;
+ if (unswapped_space_left < 0)
+ unswapped_space_left += mp3buflen;
+
                     /* should we start reading more data? */
- if(!filling && (get_unplayed_space() < MPEG_LOW_WATER)) {
+ if(!filling && (unplayed_space_left < MPEG_LOW_WATER)) {
                         filling = true;
                         queue_post(&mpeg_queue, MPEG_NEED_DATA, 0);
                         play_pending = true;
+ } else if(unswapped_space_left &&
+ unswapped_space_left > unplayed_space_left) {
+ /* Stop swapping the data from the previous file */
+ mp3buf_swapwrite = mp3buf_read;
+ play_pending = true;
                     } else {
                         playing = true;
                         if (!paused)
                             start_dma();
                     }
-
- track_change();
                 }
                 else {
                     reset_mp3_buffer();


----- Original Message -----
From: "Stuart Tedford" <stuart.tedford_at_piresearch.co.uk>
To: <rockbox_at_cool.haxx.se>
Sent: Wednesday, August 21, 2002 12:53 AM
Subject: RE: Track change silence


> I've also had this bug on my AJR20 using recent cvs builds, very rarely
> though.
>
> The time appears to pass normally during this bug.
>
> I haven't waited long enough to hear the sound return - maybe next time. I
> just press previous track then next track again and it is fine.
>
> Stu.
>
> > -----Original Message-----
> > From: Linus Nielsen Feltzing [mailto:linus_at_haxx.se]
> > Sent: 21 August 2002 08:14
> > To: rockbox_at_cool.haxx.se
> > Subject: Re: Track change silence
> >
> >
> > On Wed, 21 Aug 2002 07:20:21 +0200, Guy Devos wrote:
> > > > I've noticed that too. I've got a Player. It's interesting, huh?
> >
> > A question: does the time pass normally? Or does the seconds tick
> > faster than normal in the time display?
> >
> > /Linus
> >
> > --
> > Linus Nielsen Feltzing, linus_at_haxx.se on 2002-08-21
> >
> >
>
Received on 2002-08-22

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