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.
This commit is contained in:
parent
21bb0aab90
commit
a6ad0cdecc
@ -660,6 +660,11 @@ deleteASongFromPlaylist(const struct song *song)
|
|||||||
|
|
||||||
void stopPlaylist(void)
|
void stopPlaylist(void)
|
||||||
{
|
{
|
||||||
|
if (!playlist.playing)
|
||||||
|
return;
|
||||||
|
|
||||||
|
assert(playlist.current >= 0);
|
||||||
|
|
||||||
g_debug("playlist: stop");
|
g_debug("playlist: stop");
|
||||||
playerWait();
|
playerWait();
|
||||||
playlist.queued = -1;
|
playlist.queued = -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user