diff options
author | Alexey Yakovenko <wakeroid@gmail.com> | 2010-03-31 13:53:25 +0200 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2010-03-31 13:53:25 +0200 |
commit | d4f7499e49b40a449d04d771e1a360ac6b263648 (patch) | |
tree | 4907278a3d6823e51f8c2bd4b49f1c897082d41c /playlist.c | |
parent | d528a3051f1f4f1fc9e24fb5442158b28341f750 (diff) |
cleaned up id3v2 parser;
added support for multiple text frames of same type;
improved (?) cp1251 detection
Diffstat (limited to 'playlist.c')
-rw-r--r-- | playlist.c | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -1441,6 +1441,20 @@ pl_add_meta (playItem_t *it, const char *key, const char *value) { } void +pl_append_meta (playItem_t *it, const char *key, const char *value) { + const char *old = pl_find_meta (it, key); + if (!old) { + pl_add_meta (it, key, value); + } + else { + int sz = strlen (old) + strlen (value) + 2; + char str[sz]; + snprintf (str, sz, "%s\n%s", old, value); + pl_replace_meta (it, key, str); + } +} + +void pl_replace_meta (playItem_t *it, const char *key, const char *value) { LOCK; // check if it's already set @@ -2135,6 +2149,8 @@ pl_format_title (playItem_t *it, int idx, char *s, int size, int id, const char const char *copyright = NULL; const char *filename = NULL; + char *ss = s; + LOCK; if (id != -1) { const char *text = NULL; @@ -2279,6 +2295,15 @@ pl_format_title (playItem_t *it, int idx, char *s, int size, int id, const char *s = 0; UNLOCK; + + // replace all \n with ; + while (*ss) { + if (*ss == '\n') { + *ss = ';'; + } + ss++; + } + return size - n - 1; } |