playlist_set_current: Fix outdated dircache filerefs

Entries from a previously playing playlist may not
have been replaced after selecting a track from
a different playlist in the Playlist Viewer when
playback was stopped (not paused), since the index
buffer of a playlist opened in the Playlist Viewer
is shared with the current playlist when nothing is
playing.

Change-Id: I939e302c73cabd0e9d969550143635e54db32bf0
This commit is contained in:
Christian Soffke 2023-10-30 00:53:00 +01:00
parent 1651254ba4
commit 45746934c4

View file

@ -3509,11 +3509,9 @@ int playlist_set_current(struct playlist_info* playlist)
current_playlist.dirlen = playlist->dirlen;
if (playlist->indices && playlist->indices != current_playlist.indices)
{
memcpy((void*)current_playlist.indices, (void*)playlist->indices,
playlist->max_playlist_size*sizeof(*playlist->indices));
dc_init_filerefs(&current_playlist, 0, current_playlist.max_playlist_size);
}
dc_init_filerefs(&current_playlist, 0, current_playlist.max_playlist_size);
current_playlist.first_index = playlist->first_index;
current_playlist.amount = playlist->amount;