summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorDave Bryant <bryant@rockbox.org>2005-06-30 06:09:59 +0000
committerDave Bryant <bryant@rockbox.org>2005-06-30 06:09:59 +0000
commit1983738ea11e3b8706bab5a1e8efe5ee947bfa4f (patch)
tree294f68fe3925d47a2b006a31b98ef2f6c35c967e /apps
parentbc9a378c4f25dccbf3cc3937357a31298f2cf845 (diff)
Not sure if this is the right way to make "resume" work correctly for WavPack,
but it seems to work and if it's wrong it should only affect WavPack... git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6938 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/codecs/wavpack.c4
-rw-r--r--apps/playback.c9
2 files changed, 12 insertions, 1 deletions
diff --git a/apps/codecs/wavpack.c b/apps/codecs/wavpack.c
index 0da8a89027..39b8514fe5 100644
--- a/apps/codecs/wavpack.c
+++ b/apps/codecs/wavpack.c
@@ -33,7 +33,9 @@ static long temp_buffer [BUFFER_SIZE] IDATA_ATTR;
static long read_callback (void *buffer, long bytes)
{
- return ci->read_filebuf (buffer, bytes);
+ long retval = ci->read_filebuf (buffer, bytes);
+ ci->id3->offset = ci->curpos;
+ return retval;
}
#ifndef SIMULATOR
diff --git a/apps/playback.c b/apps/playback.c
index a89441f02a..8b4cc6eab6 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -811,6 +811,15 @@ bool audio_load_track(int offset, bool start_play, int peek_offset)
ci.curpos = offset;
tracks[track_widx].start_pos = offset;
}
+ else if (tracks[track_widx].id3.codectype==AFMT_WAVPACK) {
+ lseek(fd, offset, SEEK_SET);
+ tracks[track_widx].id3.offset = offset;
+ tracks[track_widx].id3.elapsed = tracks[track_widx].id3.length / 2;
+ tracks[track_widx].filepos = offset;
+ tracks[track_widx].filerem = tracks[track_widx].filesize - offset;
+ ci.curpos = offset;
+ tracks[track_widx].start_pos = offset;
+ }
}
if (start_play) {