mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-15 16:12:28 -05:00
First attempt at seeking in FLAC files
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6750 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
33001cb4f0
commit
defdf4b65d
1 changed files with 12 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue