Playlists: Fix losing cached control data when resuming

Shuffle and Unshuffle commands are not flushed to
disk when control data is updated. The same applies
to Delete and Reset commands, unless HAVE_DIRCACHE
is undefined (see update_control() function in playlist.c)

playlist_resume() discards cached control data.

This resulted in a bug where (e.g.) removed tracks
from the current playlist would reappear if you stopped
and resumed playing immediately afterwards (instead of
restarting in between).

Change-Id: I273f61e823a1d99426a18079b81aa07915620f30
This commit is contained in:
Christian Soffke 2022-08-11 22:38:46 +02:00 committed by Solomon Peachy
parent 8f6d0efd71
commit 5e757b4d6e

View file

@ -2154,6 +2154,7 @@ int playlist_resume(void)
}
buffer = core_get_data(handle);
playlist_shutdown(); /* flush any cached control commands to disk */
empty_playlist(playlist, true);
playlist->control_fd = open(playlist->control_filename, O_RDWR);