playlist: fix assertion when last/current song is deleted
When MPD is stopped, but the last song is still the "current song", and you delete it, playlist->current is not updated, and becomes an invalid value. Fix this by catching "!playlist->playing && playlist->current == (int)songOrder".
This commit is contained in:
parent
e8787ac4a4
commit
34244398d0
@ -243,7 +243,10 @@ deleteFromPlaylist(struct playlist *playlist, unsigned song)
|
|||||||
stopPlaylist(playlist);
|
stopPlaylist(playlist);
|
||||||
|
|
||||||
queued = NULL;
|
queued = NULL;
|
||||||
}
|
} else if (playlist->current == (int)songOrder)
|
||||||
|
/* there's a "current song" but we're not playing
|
||||||
|
currently - clear "current" */
|
||||||
|
playlist->current = -1;
|
||||||
|
|
||||||
/* now do it: remove the song */
|
/* now do it: remove the song */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user