diff options
author | Alexey Yakovenko <wakeroid@gmail.com> | 2010-06-21 21:52:06 +0200 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2010-06-21 21:52:06 +0200 |
commit | c901a7cbf52ee234220f21b85c2e77667264d16c (patch) | |
tree | 2a0e5c71c00ad95f558224e3ed67e98b686de92a /decoder_template.c | |
parent | 7088867879c41de81e485f79f60cd2bb08d456d1 (diff) |
updated decoder_template
Diffstat (limited to 'decoder_template.c')
-rw-r--r-- | decoder_template.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/decoder_template.c b/decoder_template.c index 694f8e45..1f529555 100644 --- a/decoder_template.c +++ b/decoder_template.c @@ -96,7 +96,7 @@ example_seek_sample (DB_fileinfo_t *_info, int sample) { example_info_t *info = (example_info_t *)_info; info->currentsample = sample + info->startsample; - plugin.info.readpos = (float)sample / plugin.info.samplerate; + _info->readpos = (float)sample / _info->samplerate; return 0; } @@ -105,7 +105,7 @@ example_seek_sample (DB_fileinfo_t *_info, int sample) { // return -1 on failure static int example_seek (DB_fileinfo_t *_info, float time) { - return example_seek_sample (time * plugin.info.samplerate); + return example_seek_sample (_info, time * _info->samplerate); } // read information from the track @@ -163,7 +163,7 @@ example_insert (DB_playItem_t *after, const char *fname) { // no cuesheet, prepare track for addition DB_playItem_t *it = deadbeef->pl_item_alloc (); - it->decoder = &plugin; + it->decoder_id = deadbeef->plug_get_decoder_id (plugin.plugin.id); it->fname = strdup (fname); it->filetype = filetypes[0]; deadbeef->pl_set_item_duration (it, (float)ti.total_num_samples/ti.samplerate); @@ -184,6 +184,7 @@ example_insert (DB_playItem_t *after, const char *fname) { // now the track is ready, insert into playlist after = deadbeef->pl_insert_item (after, it); + deadbeef->pl_item_unref (it); return after; } |