diff options
author | Max Kellermann <max@duempel.org> | 2012-08-25 08:44:31 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2012-08-25 09:38:41 +0200 |
commit | f351550534939478d7ddc791dc76aafd5f2a3503 (patch) | |
tree | 3672f6b43ee97f00ba7812cdfce92dda2c901437 /src/playlist | |
parent | 66ecf39efe703185b1d54775e052d1c6a3f76903 (diff) | |
download | mpd-f351550534939478d7ddc791dc76aafd5f2a3503.tar.gz mpd-f351550534939478d7ddc791dc76aafd5f2a3503.tar.xz mpd-f351550534939478d7ddc791dc76aafd5f2a3503.zip |
player_thread: disable cross-fading in "single" mode
This commit reimplements the core of the "single" mode. Instead of
doing the detection in the playlist code from the outside, it is moved
to the player thread, which gets a new option called "border_pause".
It will now pause playback exactly at the beginning of the new song,
making the feature more reliable.
Now that the player thread knows what will happen, it can suppress
cross-fading.
Fixes mantis tickets 0003055 and 0003166.
Diffstat (limited to '')
-rw-r--r-- | src/playlist.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/playlist.c b/src/playlist.c index d62865dd1..dc6d8c340 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -109,11 +109,6 @@ playlist_song_started(struct playlist *playlist, struct player_control *pc) playlist->current = playlist->queued; playlist->queued = -1; - /* Pause if we are in single mode. */ - if(playlist->queue.single && !playlist->queue.repeat) { - pc_set_pause(pc, true); - } - if(playlist->queue.consume) playlist_delete(playlist, pc, queue_order_to_position(&playlist->queue, @@ -310,7 +305,11 @@ playlist_set_repeat(struct playlist *playlist, struct player_control *pc, if (status == playlist->queue.repeat) return; - playlist->queue.repeat = status; + struct queue *queue = &playlist->queue; + + queue->repeat = status; + + pc_set_border_pause(pc, queue->single && !queue->repeat); /* if the last song is currently being played, the "next song" might change when repeat mode is toggled */ @@ -338,7 +337,11 @@ playlist_set_single(struct playlist *playlist, struct player_control *pc, if (status == playlist->queue.single) return; - playlist->queue.single = status; + struct queue *queue = &playlist->queue; + + queue->single = status; + + pc_set_border_pause(pc, queue->single && !queue->repeat); /* if the last song is currently being played, the "next song" might change when single mode is toggled */ |