summaryrefslogtreecommitdiff
path: root/playlist.c
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-11-15 12:47:01 +0100
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-11-15 12:47:01 +0100
commit0e8083c59d9bc4dc81fd779764469b838f14f8ac (patch)
tree3899a62fc45846409f6b8d1b6a477ff955e21d60 /playlist.c
parent45fd185e734b0755a843017f891b178133ae43ea (diff)
parentb0bce1c0e0042b7952341871598fcffd21ad4bf4 (diff)
Merge branch 'master' into guiplug
Conflicts: main.c plugins/gtkui/gtkplaylist.c
Diffstat (limited to 'playlist.c')
-rw-r--r--playlist.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/playlist.c b/playlist.c
index 20a58bcc..5c95c84d 100644
--- a/playlist.c
+++ b/playlist.c
@@ -608,7 +608,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);
}
@@ -823,6 +823,7 @@ pl_insert_item (playItem_t *after, playItem_t *it) {
playlist_tail[PL_MAIN] = it;
}
}
+ it->in_playlist = 1;
pl_count++;
// shuffle
@@ -1398,7 +1399,8 @@ 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
uint8_t ft;
if (fread (&ft, 1, 1, fp) != 1) {
@@ -1548,7 +1550,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;
}