summaryrefslogtreecommitdiff
path: root/plugins/ffap/ffap.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/ffap/ffap.c')
-rw-r--r--plugins/ffap/ffap.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/plugins/ffap/ffap.c b/plugins/ffap/ffap.c
index db3a505d..60ba9b18 100644
--- a/plugins/ffap/ffap.c
+++ b/plugins/ffap/ffap.c
@@ -1729,25 +1729,28 @@ ffap_insert (DB_playItem_t *after, const char *fname) {
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_unref (it);
- return cue;
- }
-
// embedded cue
deadbeef->pl_lock ();
const char *cuesheet = deadbeef->pl_find_meta (it, "cuesheet");
+ DB_playItem_t *cue = NULL;
if (cuesheet) {
cue = deadbeef->pl_insert_cue_from_buffer (after, it, cuesheet, strlen (cuesheet), ape_ctx.totalsamples, ape_ctx.samplerate);
if (cue) {
deadbeef->pl_item_unref (it);
+ deadbeef->pl_item_unref (cue);
deadbeef->pl_unlock ();
return cue;
}
}
deadbeef->pl_unlock ();
+ cue = deadbeef->pl_insert_cue (after, it, ape_ctx.totalsamples, ape_ctx.samplerate);
+ if (cue) {
+ deadbeef->pl_item_unref (it);
+ deadbeef->pl_item_unref (cue);
+ return cue;
+ }
+
deadbeef->pl_add_meta (it, "title", NULL);
after = deadbeef->pl_insert_item (after, it);
deadbeef->pl_item_unref (it);