diff options
| author | Magnus Holmgren <magnushol@gmail.com> | 2006-08-23 08:19:29 +0000 |
|---|---|---|
| committer | Magnus Holmgren <magnushol@gmail.com> | 2006-08-23 08:19:29 +0000 |
| commit | 8a3b6dad94a471f82ae39ed6507074f3c83caf7c (patch) | |
| tree | 0a83d28d6f417204eacbfff316ac65649398d7d7 /apps/codecs | |
| parent | 514ff097287882e6b70711dab181b3ab896904cb (diff) | |
| download | rockbox-8a3b6dad94a471f82ae39ed6507074f3c83caf7c.zip rockbox-8a3b6dad94a471f82ae39ed6507074f3c83caf7c.tar.gz rockbox-8a3b6dad94a471f82ae39ed6507074f3c83caf7c.tar.bz2 rockbox-8a3b6dad94a471f82ae39ed6507074f3c83caf7c.tar.xz | |
Fix broken resume for wav files.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10710 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs')
| -rw-r--r-- | apps/codecs/wav.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/apps/codecs/wav.c b/apps/codecs/wav.c index 6bf2cb5..3c86e3f 100644 --- a/apps/codecs/wav.c +++ b/apps/codecs/wav.c @@ -232,6 +232,7 @@ enum codec_status codec_start(struct codec_api *api) uint16_t blockalign = 0; uint32_t avgbytespersec = 0; off_t firstblockposn; /* position of the first block in file */ + /* Generic codec initialisation */ rb = api; @@ -253,9 +254,12 @@ next_track: goto exit; } - while (!*ci->taginfo_ready) - ci->yield(); + while (!*ci->taginfo_ready && !ci->stop_codec) + ci->sleep(1); + /* Need to save offset for later use (cleared indirectly by advance_buffer) */ + bytesdone = ci->id3->offset; + /* get RIFF chunk header */ buf = ci->request_buffer(&n, 12); if (n < 12) { @@ -420,9 +424,9 @@ next_track: } /* make sure we're at the correct offset */ - if (ci->id3->offset > (uint32_t) firstblockposn) { + if (bytesdone > (uint32_t) firstblockposn) { /* Round down to previous block */ - uint32_t offset = ci->id3->offset - ci->id3->offset % blockalign; + uint32_t offset = bytesdone - bytesdone % blockalign; ci->advance_buffer(offset-firstblockposn); bytesdone = offset - firstblockposn; |