From acff47388e6471facd73e7b41e9c94f5cda7ee11 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Wed, 6 Jan 2010 21:59:37 +0100 Subject: fixed bug in .pls parser stopping after 1st track --- playlist.c | 8 ++++++-- 1 file 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; } -- cgit v1.2.3