summaryrefslogtreecommitdiff
path: root/plugins/ffap
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-01-02 13:45:23 +0100
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-01-02 13:45:23 +0100
commit044a715c61f1b78cb569fd7711d794296b61b994 (patch)
tree64545d805efabd45c3d23e00d9729e20310f43db /plugins/ffap
parent40d3a5c66105914c1113bc7ef0649e13b3db690f (diff)
changed cuesheet loading APIs, embedded metadata now adds up with cuesheet metadata
Diffstat (limited to 'plugins/ffap')
-rw-r--r--plugins/ffap/ffap.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/plugins/ffap/ffap.c b/plugins/ffap/ffap.c
index e04ca40d..d737df02 100644
--- a/plugins/ffap/ffap.c
+++ b/plugins/ffap/ffap.c
@@ -1651,13 +1651,6 @@ ffap_insert (DB_playItem_t *after, const char *fname) {
float duration = ape_ctx.totalsamples / (float)ape_ctx.samplerate;
DB_playItem_t *it = NULL;
- it = deadbeef->pl_insert_cue (after, fname, &plugin, "APE", ape_ctx.totalsamples, ape_ctx.samplerate);
- if (it) {
- deadbeef->fclose (fp);
- ape_free_ctx (&ape_ctx);
- return it;
- }
-
it = deadbeef->pl_item_alloc ();
it->decoder = &plugin;
it->fname = strdup (fname);
@@ -1675,22 +1668,27 @@ ffap_insert (DB_playItem_t *after, const char *fname) {
/*int apeerr = */deadbeef->junk_read_ape (it, fp);
deadbeef->fclose (fp);
+ ape_free_ctx (&ape_ctx);
+
+ DB_playItem_t *cue = deadbeef->pl_insert_cue (after, it, ape_ctx.totalsamples, ape_ctx.samplerate);
+ if (cue) {
+ deadbeef->pl_item_free (it);
+ return cue;
+ }
// embedded cue
const char *cuesheet = deadbeef->pl_find_meta (it, "cuesheet");
if (cuesheet) {
- DB_playItem_t *last = deadbeef->pl_insert_cue_from_buffer (after, fname, cuesheet, strlen (cuesheet), &plugin, plugin.filetypes[0], ape_ctx.totalsamples, ape_ctx.samplerate);
- if (last) {
+ cue = deadbeef->pl_insert_cue_from_buffer (after, it, cuesheet, strlen (cuesheet), ape_ctx.totalsamples, ape_ctx.samplerate);
+ if (cue) {
deadbeef->pl_item_free (it);
- ape_free_ctx (&ape_ctx);
- return last;
+ return cue;
}
}
deadbeef->pl_add_meta (it, "title", NULL);
after = deadbeef->pl_insert_item (after, it);
- ape_free_ctx (&ape_ctx);
return after;
}