diff options
-rw-r--r-- | plugins/ape/ape.c | 3 | ||||
-rw-r--r-- | plugins/demac/demac.c | 12 |
2 files changed, 13 insertions, 2 deletions
diff --git a/plugins/ape/ape.c b/plugins/ape/ape.c index 6ce1d05c..05c67fa2 100644 --- a/plugins/ape/ape.c +++ b/plugins/ape/ape.c @@ -126,7 +126,8 @@ ape_insert (DB_playItem_t *after, const char *fname) { float duration = ape_decompress_get_info_int (dec, APE_DECOMPRESS_TOTAL_BLOCKS) / (float)wfe.nSamplesPerSec; ape_decompress_destroy (dec); - DB_playItem_t *it = deadbeef->pl_insert_cue (after, fname, &plugin, "APE", duration); + DB_playItem_t *it; + it = deadbeef->pl_insert_cue (after, fname, &plugin, "APE", duration); if (it) { return it; } diff --git a/plugins/demac/demac.c b/plugins/demac/demac.c index 5fb43313..844cb234 100644 --- a/plugins/demac/demac.c +++ b/plugins/demac/demac.c @@ -551,7 +551,8 @@ demac_insert (DB_playItem_t *after, const char *fname) { } float duration = ape_ctx.totalsamples / (float)ape_ctx.samplerate; - DB_playItem_t *it = deadbeef->pl_insert_cue (after, fname, &plugin, "APE", duration); + DB_playItem_t *it; + it = deadbeef->pl_insert_cue (after, fname, &plugin, "APE", duration); if (it) { fclose (fp); return it; @@ -563,6 +564,15 @@ demac_insert (DB_playItem_t *after, const char *fname) { it->filetype = "APE"; it->duration = duration; + int v2err = deadbeef->junk_read_id3v2 (it, fp); + int v1err = deadbeef->junk_read_id3v1 (it, fp); + if (v1err >= 0) { + fseek (fp, -128, SEEK_END); + } + else { + fseek (fp, 0, SEEK_END); + } + int apeerr = deadbeef->junk_read_ape (it, fp); deadbeef->pl_add_meta (it, "title", NULL); after = deadbeef->pl_insert_item (after, it); |