summaryrefslogtreecommitdiff
path: root/playlist.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2009-08-27 20:40:06 +0200
committerGravatar waker <wakeroid@gmail.com>2009-08-27 20:40:06 +0200
commit8c9425b1b18bc8f76f9fad25d56bd4d3466fe1e3 (patch)
treeac42850f2d5b2d4fcda3743089583e94499c4a32 /playlist.c
parent931baf241fff9b61010076da7f183db983db11f6 (diff)
parentf66ceea04ef9a373398f0416130b300629405952 (diff)
Merge branch 'master' into plugins
Conflicts: playlist.c
Diffstat (limited to 'playlist.c')
-rw-r--r--playlist.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/playlist.c b/playlist.c
index 87ec35c4..52302d6a 100644
--- a/playlist.c
+++ b/playlist.c
@@ -584,7 +584,7 @@ int
pl_set_current (playItem_t *it) {
int ret = 0;
int from = pl_get_idx_of (playlist_current_ptr);
- int to = pl_get_idx_of (it);
+ int to = it ? pl_get_idx_of (it) : -1;
#if 0
// this produces some kind of bug in the beginning of track
if (it == playlist_current_ptr) {
@@ -617,10 +617,12 @@ pl_set_current (playItem_t *it) {
}
if (it) {
pl_item_copy (&playlist_current, it);
+ it->played = 1;
}
codec_unlock ();
- it->played = 1;
- plug_trigger_event (DB_EV_SONGSTARTED);
+ if (it) {
+ plug_trigger_event (DB_EV_SONGSTARTED);
+ }
messagepump_push (M_SONGCHANGED, 0, from, to);
return ret;
}