diff options
author | Thom Johansen <thomj@rockbox.org> | 2005-11-06 19:18:04 +0000 |
---|---|---|
committer | Thom Johansen <thomj@rockbox.org> | 2005-11-06 19:18:04 +0000 |
commit | c8193b8da503859eeeb4d551fdbe523759421394 (patch) | |
tree | 937720a001329dd5924a7d00a1d7265b121cf031 /apps | |
parent | 741012004b996375bba172fc4beb0bff92ce15db (diff) |
The seek_time member of the codec API needs to be decremented before use as a seeking time.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7768 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/codecs/a52.c | 2 | ||||
-rw-r--r-- | apps/codecs/aac.c | 2 | ||||
-rw-r--r-- | apps/codecs/alac.c | 2 | ||||
-rw-r--r-- | apps/codecs/flac.c | 2 | ||||
-rw-r--r-- | apps/codecs/vorbis.c | 2 | ||||
-rw-r--r-- | apps/codecs/wav.c | 2 | ||||
-rw-r--r-- | apps/codecs/wavpack.c | 1 |
7 files changed, 7 insertions, 6 deletions
diff --git a/apps/codecs/a52.c b/apps/codecs/a52.c index b658893023..050bfff25d 100644 --- a/apps/codecs/a52.c +++ b/apps/codecs/a52.c @@ -162,7 +162,7 @@ next_track: break; if (ci->seek_time) { - sample_loc = ci->seek_time/1000 * ci->id3->frequency; + sample_loc = (ci->seek_time - 1)/1000 * ci->id3->frequency; if (ci->seek_buffer((sample_loc/A52_SAMPLESPERFRAME)*ci->id3->bytesperframe)) { samplesdone = sample_loc; diff --git a/apps/codecs/aac.c b/apps/codecs/aac.c index 5bb9241d3b..f6a6de53da 100644 --- a/apps/codecs/aac.c +++ b/apps/codecs/aac.c @@ -126,7 +126,7 @@ enum codec_status codec_start(struct codec_api* api) /* Deal with any pending seek requests */ if (ci->seek_time) { if (alac_seek(&demux_res,&input_stream, - (ci->seek_time/10) * (ci->id3->frequency/100), + ((ci->seek_time-1)/10) * (ci->id3->frequency/100), &samplesdone, &i)) { elapsedtime=(samplesdone*10)/(ci->id3->frequency/100); ci->set_elapsed(elapsedtime); diff --git a/apps/codecs/alac.c b/apps/codecs/alac.c index dcad760f90..1ecaab6b85 100644 --- a/apps/codecs/alac.c +++ b/apps/codecs/alac.c @@ -103,7 +103,7 @@ enum codec_status codec_start(struct codec_api* api) /* Deal with any pending seek requests */ if (ci->seek_time) { if (alac_seek(&demux_res,&input_stream, - (ci->seek_time/10) * (ci->id3->frequency/100), + ((ci->seek_time-1)/10) * (ci->id3->frequency/100), &samplesdone, &i)) { elapsedtime=(samplesdone*10)/(ci->id3->frequency/100); ci->set_elapsed(elapsedtime); diff --git a/apps/codecs/flac.c b/apps/codecs/flac.c index fff301b65a..b94152dec5 100644 --- a/apps/codecs/flac.c +++ b/apps/codecs/flac.c @@ -272,7 +272,7 @@ enum codec_status codec_start(struct codec_api* api) /* Deal with any pending seek requests */ if (ci->seek_time) { - if (flac_seek(&fc,(ci->seek_time/20) * (ci->id3->frequency/50))) { + if (flac_seek(&fc,((ci->seek_time-1)/20)*(ci->id3->frequency/50))) { /* Refill the input buffer */ buf = ci->request_buffer(&bytesleft, MAX_FRAMESIZE); } diff --git a/apps/codecs/vorbis.c b/apps/codecs/vorbis.c index 475c64c4b5..1fbe131e10 100644 --- a/apps/codecs/vorbis.c +++ b/apps/codecs/vorbis.c @@ -209,7 +209,7 @@ next_track: break; if (rb->seek_time) { - if (ov_time_seek(&vf, rb->seek_time)) { + if (ov_time_seek(&vf, rb->seek_time - 1)) { //rb->logf("ov_time_seek failed"); } rb->seek_complete(); diff --git a/apps/codecs/wav.c b/apps/codecs/wav.c index 21f1c4f09f..6bf7bcd408 100644 --- a/apps/codecs/wav.c +++ b/apps/codecs/wav.c @@ -444,7 +444,7 @@ enum codec_status codec_start(struct codec_api* api) /* use avgbytespersec to round to the closest blockalign multiple, add firstblockposn. 64-bit casts to avoid overflows. */ - newpos = (((uint64_t)avgbytespersec * ci->seek_time) + newpos = (((uint64_t)avgbytespersec * (ci->seek_time - 1)) / (1000LL*blockalign)) * blockalign; if (newpos > numbytes) break; diff --git a/apps/codecs/wavpack.c b/apps/codecs/wavpack.c index fd346d28c8..93f5002538 100644 --- a/apps/codecs/wavpack.c +++ b/apps/codecs/wavpack.c @@ -107,6 +107,7 @@ enum codec_status codec_start(struct codec_api* api) long nsamples; if (ci->seek_time && ci->taginfo_ready && ci->id3->length) { + ci->seek_time--; int curpos_ms = WavpackGetSampleIndex (wpc) / sr_100 * 10; int n, d, skip; |