diff options
author | Alexey Yakovenko <wakeroid@gmail.com> | 2009-11-14 12:24:40 +0100 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2009-11-14 12:24:40 +0100 |
commit | aa316a84dd9f25bd1574a50db7ae64a4654beff4 (patch) | |
tree | ecb3331e5531603d3509e444e90adf860e62b7cb /playlist.c | |
parent | 72a7cb6212ae0436adc66f43fe5e140a57469378 (diff) |
optimized pl_set_item_duration
Diffstat (limited to 'playlist.c')
-rw-r--r-- | playlist.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -606,7 +606,7 @@ pl_insert_file (playItem_t *after, const char *fname, int *pabort, int (*cb)(pla it->decoder = NULL; it->fname = strdup (fname); it->filetype = "content"; - pl_set_item_duration (it, -1); + it->_duration = -1; pl_add_meta (it, "title", NULL); return pl_insert_item (after, it); } @@ -821,6 +821,7 @@ pl_insert_item (playItem_t *after, playItem_t *it) { playlist_tail[PL_MAIN] = it; } } + it->in_playlist = 1; pl_count++; // shuffle @@ -1396,7 +1397,6 @@ pl_load (const char *fname) { if (fread (&d, 1, 4, fp) != 4) { goto load_fail; } -// pl_set_item_duration (it, d); it->_duration = d; pl_totaltime += d; // get const filetype string from decoder @@ -1548,7 +1548,8 @@ pl_delete_all_meta (playItem_t *it) { void pl_set_item_duration (playItem_t *it, float duration) { - if (pl_get_idx_of (it) != -1) { +// if (pl_get_idx_of (it) != -1) { + if (it->in_playlist) { if (it->_duration > 0) { pl_totaltime -= it->_duration; } |