aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-12-17 16:45:49 +0100
committerMax Kellermann <max@duempel.org>2008-12-17 16:45:49 +0100
commit13192546a8386d91cac9045e86566906c220f3f6 (patch)
tree5d06c7b386d92f426f48dd5ec5f07aefd72e08d7 /src/playlist.c
parent25c04a97d3bab513134d78153a0fb0c3ac0fd553 (diff)
downloadmpd-13192546a8386d91cac9045e86566906c220f3f6.tar.gz
mpd-13192546a8386d91cac9045e86566906c220f3f6.tar.xz
mpd-13192546a8386d91cac9045e86566906c220f3f6.zip
playlist: clear pc.errored_song on delete
When a (remote) song is deleted from the playlist, there may still be a reference to it in pc.errored_song. Clear this reference.
Diffstat (limited to '')
-rw-r--r--src/playlist.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/playlist.c b/src/playlist.c
index 8d6d246f5..ba69844de 100644
--- a/src/playlist.c
+++ b/src/playlist.c
@@ -200,8 +200,10 @@ void clearPlaylist(void)
stopPlaylist();
for (unsigned i = 0; i < playlist.length; i++) {
- if (!song_in_database(playlist.songs[i]))
+ if (!song_in_database(playlist.songs[i])) {
+ pc_song_deleted(playlist.songs[i]);
song_free(playlist.songs[i]);
+ }
playlist.idToPosition[playlist.positionToId[i]] = -1;
playlist.songs[i] = NULL;
@@ -670,8 +672,10 @@ enum playlist_result deleteFromPlaylist(unsigned song)
|| playlist.order[playlist.current] == song))
clearPlayerQueue();
- if (!song_in_database(playlist.songs[song]))
+ if (!song_in_database(playlist.songs[song])) {
+ pc_song_deleted(playlist.songs[song]);
song_free(playlist.songs[song]);
+ }
playlist.idToPosition[playlist.positionToId[song]] = -1;
@@ -738,6 +742,8 @@ deleteASongFromPlaylist(const struct song *song)
for (unsigned i = 0; i < playlist.length; i++)
if (song == playlist.songs[i])
deleteFromPlaylist(i);
+
+ pc_song_deleted(song);
}
void stopPlaylist(void)