summaryrefslogtreecommitdiff
path: root/plugins/demac
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2009-09-03 22:04:07 +0200
committerGravatar waker <wakeroid@gmail.com>2009-09-03 22:06:35 +0200
commit0b142452f294a8843c57150de020658dc321671a (patch)
treea206681ff79f3be4c6deee5735c0b871258fbcc5 /plugins/demac
parentead6a984ab0fbafdd694681637c3fc1894003ce7 (diff)
added tag reading support to demac plugin
Diffstat (limited to 'plugins/demac')
-rw-r--r--plugins/demac/demac.c12
1 files changed, 11 insertions, 1 deletions
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);