aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist.c
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-08-23 16:26:00 -0700
committerEric Wong <normalperson@yhbt.net>2008-08-23 16:26:00 -0700
commit087998b644a08504a2f7d843a8d16bc9d91ecbc0 (patch)
tree788685f95c8f1346bfd8a310b43fd088f05c3cef /src/playlist.c
parent5655d2e5922955763455134814035e7ad76d2529 (diff)
downloadmpd-087998b644a08504a2f7d843a8d16bc9d91ecbc0.tar.gz
mpd-087998b644a08504a2f7d843a8d16bc9d91ecbc0.tar.xz
mpd-087998b644a08504a2f7d843a8d16bc9d91ecbc0.zip
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).
Diffstat (limited to 'src/playlist.c')
-rw-r--r--src/playlist.c6
1 files changed, 6 insertions, 0 deletions
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;