summaryrefslogtreecommitdiff
path: root/plugins/mpgmad
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-01-30 21:45:27 +0100
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-01-30 21:45:27 +0100
commit7cb1ac08b6ec36d83b14fb69b6924eb484e43c4c (patch)
tree7ea0b9bf41e8013756c8b34ef4c779666ce2f0be /plugins/mpgmad
parent3a68e7c2ca41e9c13e4930ce644418ab75681765 (diff)
improved icy metadata support
Diffstat (limited to 'plugins/mpgmad')
-rw-r--r--plugins/mpgmad/mpgmad.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/plugins/mpgmad/mpgmad.c b/plugins/mpgmad/mpgmad.c
index ea09cc8e..6ad884e4 100644
--- a/plugins/mpgmad/mpgmad.c
+++ b/plugins/mpgmad/mpgmad.c
@@ -839,8 +839,17 @@ cmp3_stream_frame (void) {
buffer.last_comment_update = buffer.currentsample;
const char *vfs_tit = deadbeef->fget_content_name (buffer.file);
if (vfs_tit) {
- deadbeef->pl_replace_meta (buffer.it, "title", vfs_tit);
- deadbeef->sendmessage (M_TRACKCHANGED, 0, idx, 0);
+ const char *cs = deadbeef->junk_detect_charset (vfs_tit);
+ if (cs) {
+ char out[1024];
+ deadbeef->junk_recode (vfs_tit, strlen (vfs_tit), out, sizeof (out), cs);
+ deadbeef->pl_replace_meta (buffer.it, "title", out);
+ deadbeef->sendmessage (M_TRACKCHANGED, 0, idx, 0);
+ }
+ else {
+ deadbeef->pl_replace_meta (buffer.it, "title", vfs_tit);
+ deadbeef->sendmessage (M_TRACKCHANGED, 0, idx, 0);
+ }
}
}
}