diff options
author | 2010-01-02 13:45:23 +0100 | |
---|---|---|
committer | 2010-01-02 13:45:23 +0100 | |
commit | 044a715c61f1b78cb569fd7711d794296b61b994 (patch) | |
tree | 64545d805efabd45c3d23e00d9729e20310f43db /plugins/mpgmad | |
parent | 40d3a5c66105914c1113bc7ef0649e13b3db690f (diff) |
changed cuesheet loading APIs, embedded metadata now adds up with cuesheet metadata
Diffstat (limited to 'plugins/mpgmad')
-rw-r--r-- | plugins/mpgmad/mpgmad.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/plugins/mpgmad/mpgmad.c b/plugins/mpgmad/mpgmad.c index abee585b..f48202a0 100644 --- a/plugins/mpgmad/mpgmad.c +++ b/plugins/mpgmad/mpgmad.c @@ -1017,26 +1017,25 @@ cmp3_insert (DB_playItem_t *after, const char *fname) { break; } } - // FIXME! bad numsamples passed to cue - DB_playItem_t *cue_after = deadbeef->pl_insert_cue (after, fname, &plugin, ftype, buffer.duration*buffer.samplerate, buffer.samplerate); - if (cue_after) { - deadbeef->fclose (fp); - return cue_after; - } - - deadbeef->rewind (fp); - DB_playItem_t *it = deadbeef->pl_item_alloc (); it->decoder = &plugin; it->fname = strdup (fname); + deadbeef->rewind (fp); int apeerr = deadbeef->junk_read_ape (it, fp); int v2err = deadbeef->junk_read_id3v2 (it, fp); int v1err = deadbeef->junk_read_id3v1 (it, fp); - deadbeef->fclose (fp); deadbeef->pl_add_meta (it, "title", NULL); deadbeef->pl_set_item_duration (it, buffer.duration); it->filetype = ftype; + deadbeef->fclose (fp); + + // FIXME! bad numsamples passed to cue + DB_playItem_t *cue_after = deadbeef->pl_insert_cue (after, it, buffer.duration*buffer.samplerate, buffer.samplerate); + if (cue_after) { + deadbeef->pl_item_free (it); + return cue_after; + } after = deadbeef->pl_insert_item (after, it); return after; |