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



Rockbox mail archive

Subject: Re: [PATCH] Fast-Forward/Rewind

Re: [PATCH] Fast-Forward/Rewind

From: Hardeep Sidhu <hardeeps_at_pobox.com>
Date: Thu, 15 Aug 2002 09:24:09 -0700

Doh! Okay, the patch below fixes both cases. There is a small delay in the update
in the case you mention because the mpeg thread is busy working on reading the
files from disk and swapping the data.

-Hardeep

Index: firmware/mpeg.c
===================================================================
RCS file: /cvsroot/rockbox/firmware/mpeg.c,v
retrieving revision 1.90
diff -u -b -r1.90 mpeg.c
--- firmware/mpeg.c 15 Aug 2002 05:44:26 -0000 1.90
+++ firmware/mpeg.c 15 Aug 2002 16:12:19 -0000
_at__at_ -455,13 +455,34 _at__at_
     return space;
 }

+static int get_unplayed_space_current_song(void)
+{
+ int space;
+
+ if (num_tracks_in_memory() > 1)
+ {
+ int track_offset = (tag_read_idx+1) & MAX_ID3_TAGS_MASK;
+
+ space = id3tags[track_offset]->mempos - mp3buf_read;
+ }
+ else
+ {
+ space = mp3buf_write - mp3buf_read;
+ }
+
+ if (space < 0)
+ space = mp3buflen + space;
+
+ return space;
+}
+
 static void init_dma(void)
 {
     SAR3 = (unsigned int) mp3buf + mp3buf_read;
     DAR3 = 0x5FFFEC3;
     CHCR3 &= ~0x0002; /* Clear interrupt */
     CHCR3 = 0x1504; /* Single address destination, TXI0, IE=1 */
- last_dma_chunk_size = MIN(65536, get_unplayed_space());
+ last_dma_chunk_size = MIN(65536, get_unplayed_space_current_song());
     DTCR3 = last_dma_chunk_size & 0xffff;
     DMAOR = 0x0001; /* Enable DMA */
     CHCR3 |= 0x0001; /* Enable DMA IRQ */

----- Original Message -----
From: "Justin Heiner" <jheiner_at_yahoo.com>
To: <rockbox_at_cool.haxx.se>
Sent: Thursday, August 15, 2002 3:41 AM
Subject: Re: [PATCH] Fast-Forward/Rewind


> Almost there Hardeep :) That patch only works for me if I'm only near the end
> of the song already (i guess that means it's only working if you're fast
> forwarding within the buffer). If I do it from say, the start of the song, then
> it doesn't work (does the same thing as before).
>
> -Justin
Received on 2002-08-15

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