summaryrefslogtreecommitdiff
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
parentead6a984ab0fbafdd694681637c3fc1894003ce7 (diff)
added tag reading support to demac plugin
-rw-r--r--plugins/ape/ape.c3
-rw-r--r--plugins/demac/demac.c12
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);