From e96779de48be1f1b0080a8e1cfa89756c40e562d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 9 Aug 2012 22:19:39 +0200 Subject: player_control: duplicate the song object Make sure the player "owns" the next_song object, so nobody else can free it. --- src/playlist_control.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/playlist_control.c') 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 @@ -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); -- cgit v1.2.3