summaryrefslogtreecommitdiff
path: root/playlist.c
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-04-02 18:52:08 +0200
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-04-02 18:52:08 +0200
commit18105c8b91dbe5a45bff2021c83696eba884444c (patch)
tree4ca85c195773f32fd7d228601eb111cc7a3a6e83 /playlist.c
parent91e6c9743f449c64351fff801e2abd528ebdcd4b (diff)
fixed crashbug in m3u loader
Diffstat (limited to 'playlist.c')
-rw-r--r--playlist.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/playlist.c b/playlist.c
index f0c93344..4f027460 100644
--- a/playlist.c
+++ b/playlist.c
@@ -765,6 +765,7 @@ pl_insert_cue (playItem_t *after, playItem_t *origin, int numsamples, int sample
playItem_t *
pl_insert_m3u (playItem_t *after, const char *fname, int *pabort, int (*cb)(playItem_t *it, void *data), void *user_data) {
+ trace ("enter pl_insert_m3u\n");
// skip all empty lines and comments
DB_FILE *fp = vfs_fopen (fname);
if (!fp) {
@@ -789,9 +790,6 @@ pl_insert_m3u (playItem_t *after, const char *fname, int *pabort, int (*cb)(play
const uint8_t *p = buffer;
const uint8_t *end = buffer+sz;
LOCK;
- if (after) {
- pl_item_ref (after);
- }
while (p < end) {
p = pl_str_skipspaces (p, end);
if (p >= end) {
@@ -814,11 +812,8 @@ pl_insert_m3u (playItem_t *after, const char *fname, int *pabort, int (*cb)(play
uint8_t nm[n+1];
memcpy (nm, p, n);
nm[n] = 0;
- trace ("adding file %s\n", nm);
+ trace ("pl_insert_m3u: adding file %s\n", nm);
playItem_t *it = pl_insert_file (after, nm, pabort, cb, user_data);
- if (after) {
- pl_item_unref (after);
- }
if (it) {
after = it;
}
@@ -832,6 +827,7 @@ pl_insert_m3u (playItem_t *after, const char *fname, int *pabort, int (*cb)(play
}
}
UNLOCK;
+ trace ("leave pl_insert_m3u\n");
return after;
}