diff options
author | Eric Wong <normalperson@yhbt.net> | 2008-08-23 16:26:00 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-08-23 16:26:00 -0700 |
commit | 087998b644a08504a2f7d843a8d16bc9d91ecbc0 (patch) | |
tree | 788685f95c8f1346bfd8a310b43fd088f05c3cef | |
parent | 5655d2e5922955763455134814035e7ad76d2529 (diff) | |
download | mpd-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).
-rw-r--r-- | src/playlist.c | 6 |
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; |