Bugzilla – Bug 1457
Won't advance if song added to playlist while last song playing.
Last modified: 2008-08-18 10:54:16 UTC
If a song is added to the playlist while the LAST song in a playlist is playing, the player will not advance to the next song, i.e., it stops after playing the current song.
Vidur: Is this because we're in playout-stop at the end of a playlist and the playlist is modified?
Yup. If the song is added after we've finished streaming the last song, my guess is that we stick in playout-stop mode. We should detect this case and move to playout-play.
I'm seeing the same behaviour with v6.1 (2005-06-22 nightly) on WinXP SP2 with SB2 over wireless. This is with FLAC tracks that are transcoded to FLAC to use their ReplayGain information. I've not played around with different file types or older versions of SlimServer, but can do to help. That said, the comments below suggest it's a generic issue anyway.
I'd be willing to help tackle this. I can see where it slips into playout-stop, then closes the streaming socket. In Command.pm, the commands that we'd want to detect all do a push of the new track(s) into the playlist. i could change this to a function call that does the push, and also does something equivalent to skipahead(). However, skipahead isn't exactly right since it starts off at the new song. Is there something in there already that re-links? I expect that the client reconnect must do this (in the case of small dropouts). Tips would be welcome while I'm hunting.
Created attachment 565 [details] when adding tracks during playout-stop, change to playout-play This actually seems to work. I know it doesn't look terribly elegant, but it is pretty simple. in each case where we are adding, simply change playmode to playmode-play if its in playmode-stop. This isn't needed for loads, plays, or inserts since non of those deal with adding to the end when at the end of a playlist. the old style 'add' isn't patched here since the change would have to be in load_done() where I dont think we know what the original command was. I could detect based on currentSongIndex vs playlist size, but the 'add' command is old and mostly disused.
I'm wondering if the better place for the playout-stop -> playout-play change is in Slim::Player::Playlist(), either in reshuffle() itself or in modifyPlaylistCallback(). This is generally the place where player state changes happen in response to playlist changes.
Created attachment 570 [details] playout-stop -> playout-play in Slim::Player::Playlist::reshuffle In reshuffle() check if we're in playout-stop, but not on the last track. Thoughts, kdf?
Note that the new patch also deals with the case where we have synched players - the playmode needs to be changed for all of them, as it is in Slim::Player::Source::playmode().
in principle, it looks good. I wont be able to test until this evening.
Asked Dan to review and committed change 3535 after doing some testing.
This bug was marked resolved in Slimserver 6.1, which is several versions ago. If you're still seeing this bug, please re-open it. Thanks!