summaryrefslogtreecommitdiff
path: root/apps/plugins/codecflac.c
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2005-06-18 20:57:01 +0000
committerDave Chapman <dave@dchapman.com>2005-06-18 20:57:01 +0000
commitdefdf4b65d8d9ef527333d62ad572d2d7a67479b (patch)
tree9ceaf0b68216b5a0fe75b4464e7cf82ed857f11e /apps/plugins/codecflac.c
parent33001cb4f00a52c0d8ea9ba695f7d310eefd9901 (diff)
downloadrockbox-defdf4b65d8d9ef527333d62ad572d2d7a67479b.zip
rockbox-defdf4b65d8d9ef527333d62ad572d2d7a67479b.tar.gz
rockbox-defdf4b65d8d9ef527333d62ad572d2d7a67479b.tar.bz2
rockbox-defdf4b65d8d9ef527333d62ad572d2d7a67479b.tar.xz
First attempt at seeking in FLAC files
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6750 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/codecflac.c')
-rw-r--r--apps/plugins/codecflac.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/plugins/codecflac.c b/apps/plugins/codecflac.c
index fbbf689..1cc95b3 100644
--- a/apps/plugins/codecflac.c
+++ b/apps/plugins/codecflac.c
@@ -223,6 +223,18 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parm)
if (ci->stop_codec || ci->reload_codec) {
break;
}
+
+ if (ci->seek_time) {
+ int sample_loc;
+
+ sample_loc = ci->seek_time/1000 * ci->id3->frequency;
+ if (FLAC__seekable_stream_decoder_seek_absolute(flacDecoder,sample_loc)) {
+ samplesdone=sample_loc;
+ ci->set_elapsed(samplesdone/(ci->id3->frequency/1000));
+ }
+ ci->seek_time = 0;
+ }
+
FLAC__seekable_stream_decoder_process_single(flacDecoder);
}