summaryrefslogtreecommitdiff
path: root/plugins/wma
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2013-07-07 23:07:50 +0200
committerGravatar waker <wakeroid@gmail.com>2013-07-07 23:08:02 +0200
commit3e71fdc649f2d181d32187b00032895eab58bd3b (patch)
tree5e5df11b60259eef1f979cfae51871f9fe4c5958 /plugins/wma
parent1282b9029aba4b2a903c7dfe35b154dd262b7aeb (diff)
wma: experimental embedded cue support; reload metadata support
Diffstat (limited to 'plugins/wma')
-rw-r--r--plugins/wma/asfheader.c4
-rw-r--r--plugins/wma/wma_plugin.c9
2 files changed, 13 insertions, 0 deletions
diff --git a/plugins/wma/asfheader.c b/plugins/wma/asfheader.c
index c6e84e89..97c37256 100644
--- a/plugins/wma/asfheader.c
+++ b/plugins/wma/asfheader.c
@@ -653,6 +653,10 @@ static int asf_parse_header(DB_FILE *fd, asf_waveformatex_t* wfx, DB_playItem_t
unsigned char *s = id3buf;
asf_utf16LEdecode(fd, length, &id3buf, &id3buf_remaining);
deadbeef->pl_append_meta (it, "composer", s);
+ } else if ((!strcasecmp("foobar2000/cuesheet", utf8buf)) && (type == 0)) {
+ unsigned char *s = id3buf;
+ asf_utf16LEdecode(fd, length, &id3buf, &id3buf_remaining);
+ deadbeef->pl_append_meta (it, "cuesheet", s);
} else if (!strcmp("WM/Year", utf8buf)) {
if (type == 0) {
unsigned char *s = id3buf;
diff --git a/plugins/wma/wma_plugin.c b/plugins/wma/wma_plugin.c
index c41f113b..f997d0a4 100644
--- a/plugins/wma/wma_plugin.c
+++ b/plugins/wma/wma_plugin.c
@@ -357,6 +357,15 @@ wmaplug_seek (DB_fileinfo_t *_info, float t) {
static int
wmaplug_read_metadata (DB_playItem_t *it) {
+ deadbeef->pl_delete_all_meta (it);
+ DB_FILE *fp = deadbeef->fopen (deadbeef->pl_find_meta (it, ":URI"));
+ if (!fp) {
+ return -1;
+ }
+ asf_waveformatex_t wfx;
+ int64_t first_frame_offset;
+ get_asf_metadata (fp, it, &wfx, &first_frame_offset);
+ deadbeef->fclose (fp);
return 0;
}