From 2d0b00f6bbd326790c053961ccec07106cb172c7 Mon Sep 17 00:00:00 2001 From: waker Date: Wed, 9 Mar 2011 11:38:38 +0100 Subject: moved most of track properties from playItem struct to metadata implemented track properties with multiple selection --- plugins/sndfile/sndfile.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'plugins/sndfile') diff --git a/plugins/sndfile/sndfile.c b/plugins/sndfile/sndfile.c index 85c96907..57d09763 100644 --- a/plugins/sndfile/sndfile.c +++ b/plugins/sndfile/sndfile.c @@ -155,9 +155,9 @@ sndfile_init (DB_fileinfo_t *_info, DB_playItem_t *it) { sndfile_info_t *info = (sndfile_info_t*)_info; SF_INFO inf; - DB_FILE *fp = deadbeef->fopen (it->fname); + DB_FILE *fp = deadbeef->fopen (deadbeef->pl_find_meta (it, ":URI")); if (!fp) { - trace ("sndfile: failed to open %s\n", it->fname); + trace ("sndfile: failed to open %s\n", deadbeef->pl_find_meta (it, ":URI")); return -1; } int fsize = deadbeef->fgetlength (fp); @@ -315,9 +315,7 @@ sndfile_insert (DB_playItem_t *after, const char *fname) { deadbeef->fclose (info.file); float duration = (float)totalsamples / samplerate; - DB_playItem_t *it = deadbeef->pl_item_alloc (); - it->decoder_id = deadbeef->plug_get_decoder_id (plugin.plugin.id); - it->fname = strdup (fname); + DB_playItem_t *it = deadbeef->pl_item_alloc_init (fname, plugin.plugin.id); it->filetype = "wav"; deadbeef->pl_set_item_duration (it, duration); -- cgit v1.2.3