Commit a6ad0cde authored by Max Kellermann's avatar Max Kellermann

playlist: fix "clear" crash in random mode

When MPD is not playing while in random mode, and the client issues the "clear" command, MPD crashes in stopPlaylist(), or more exactly, in queue_order_to_position(-1). Exit from stopPlaylist() if MPD isn't playing.
parent 21bb0aab
......@@ -660,6 +660,11 @@ deleteASongFromPlaylist(const struct song *song)
void stopPlaylist(void)
{
if (!playlist.playing)
return;
assert(playlist.current >= 0);
g_debug("playlist: stop");
playerWait();
playlist.queued = -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment