From 087998b644a08504a2f7d843a8d16bc9d91ecbc0 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 23 Aug 2008 16:26:00 -0700 Subject: playlist: queue songs after adding them This fixes the case where we wouldn't start playing a newly added song if we're near the end of the playlist and done decoding the last song (but still playing from the buffer). --- src/playlist.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/playlist.c') diff --git a/src/playlist.c b/src/playlist.c index fa355bcaa..7a9a0ea6c 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -682,6 +682,12 @@ int addSongToPlaylist(int fd, Song * song, int *added_id) incrPlaylistVersion(); + /* we could be playing (but done decoding) the last song */ + if (ob_get_state() != OB_STATE_STOP) { + playlist_state = PLAYLIST_STATE_PLAY; + queueNextSongInPlaylist(); + } + if (added_id) *added_id = id; -- cgit v1.2.3