Bug 1457 - Won't advance if song added to playlist while last song playing.
: Won't advance if song added to playlist while last song playing.
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Playlists
: 6.0.2
: PC Windows XP
: P2 normal (vote)
: ---
Assigned To: Vidur Apparao
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-04-28 04:43 UTC by jeff
Modified: 2008-08-18 10:54 UTC (History)
1 user (show)

See Also:
Category: ---


Attachments
when adding tracks during playout-stop, change to playout-play (1.78 KB, patch)
2005-06-23 23:12 UTC, KDF
Details | Diff
playout-stop -> playout-play in Slim::Player::Playlist::reshuffle (605 bytes, patch)
2005-06-24 11:09 UTC, Vidur Apparao
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jeff 2005-04-28 04:43:57 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.
Comment 1 Blackketter Dean 2005-05-20 16:23:28 UTC
Vidur: Is this because we're in playout-stop at the end of a playlist and the playlist is modified?
Comment 2 Vidur Apparao 2005-05-23 12:21:51 UTC
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.
Comment 3 Nigel Birch 2005-06-23 07:00:29 UTC
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.
Comment 4 Nigel Birch 2005-06-23 07:01:28 UTC
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.
Comment 5 KDF 2005-06-23 22:00:56 UTC
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.
Comment 6 KDF 2005-06-23 23:12:18 UTC
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.
Comment 7 Vidur Apparao 2005-06-24 10:36:13 UTC
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.
Comment 8 Vidur Apparao 2005-06-24 11:09:32 UTC
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?
Comment 9 Vidur Apparao 2005-06-24 11:21:22 UTC
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().
Comment 10 KDF 2005-06-24 11:51:51 UTC
in principle, it looks good.  I wont be able to test until this evening.
Comment 11 Vidur Apparao 2005-06-24 12:04:32 UTC
Asked Dan to review and committed change 3535 after doing some testing. 
Comment 12 Chris Owens 2008-03-11 11:28:12 UTC
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!