aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist_control.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-08-09 22:19:39 +0200
committerMax Kellermann <max@duempel.org>2012-08-15 23:09:22 +0200
commite96779de48be1f1b0080a8e1cfa89756c40e562d (patch)
tree58a329d5e1719733019cef09bbbc6f6c0ae8f579 /src/playlist_control.c
parenteb54337c40cbedc79177b48d2feaea9d12e95c0f (diff)
downloadmpd-e96779de48be1f1b0080a8e1cfa89756c40e562d.tar.gz
mpd-e96779de48be1f1b0080a8e1cfa89756c40e562d.tar.xz
mpd-e96779de48be1f1b0080a8e1cfa89756c40e562d.zip
player_control: duplicate the song object
Make sure the player "owns" the next_song object, so nobody else can free it.
Diffstat (limited to '')
-rw-r--r--src/playlist_control.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/playlist_control.c b/src/playlist_control.c
index 0dea7676a..57cc428fe 100644
--- a/src/playlist_control.c
+++ b/src/playlist_control.c
@@ -25,6 +25,7 @@
#include "config.h"
#include "playlist_internal.h"
#include "player_control.h"
+#include "song.h"
#include "idle.h"
#include <glib.h>
@@ -239,7 +240,9 @@ playlist_seek_song(struct playlist *playlist, struct player_control *pc,
queued = NULL;
}
- success = pc_seek(pc, queue_get_order(&playlist->queue, i), seek_time);
+ struct song *the_song =
+ song_dup_detached(queue_get_order(&playlist->queue, i));
+ success = pc_seek(pc, the_song, seek_time);
if (!success) {
playlist_update_queued_song(playlist, pc, queued);