summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-01-06 21:59:37 +0100
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-01-06 21:59:37 +0100
commitacff47388e6471facd73e7b41e9c94f5cda7ee11 (patch)
treed4954bc78f96b2859171ac01586583d6069b64b8
parentdd7d9db0a3858006c2f10eab5d08eb0ea9709712 (diff)
fixed bug in .pls parser stopping after 1st track
-rw-r--r--playlist.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/playlist.c b/playlist.c
index 91de23b3..86cb22da 100644
--- a/playlist.c
+++ b/playlist.c
@@ -544,6 +544,7 @@ pl_insert_pls (playItem_t *after, const char *fname, int *pabort, int (*cb)(play
break;
}
p += 6;
+ // skip =
while (p < end && *p != '=') {
p++;
}
@@ -558,18 +559,21 @@ pl_insert_pls (playItem_t *after, const char *fname, int *pabort, int (*cb)(play
n = e-p;
n = min (n, sizeof (length)-1);
memcpy (length, p, n);
- length[n] = 0;
- trace ("length: %s\n", length);
// add track
playItem_t *it = pl_insert_file (after, url, pabort, cb, user_data);
if (it) {
after = it;
pl_set_item_duration (it, atoi (length));
+ pl_delete_all_meta (it);
pl_add_meta (it, "title", title);
}
if (pabort && *pabort) {
return after;
}
+ while (e < end && *e < 0x20) {
+ e++;
+ }
+ p = e;
}
return after;
}