diff options
author | Max Kellermann <max@duempel.org> | 2011-02-23 09:09:48 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2011-02-23 09:10:23 +0100 |
commit | 2fb40fe728ac07574808c40034fc0f3d2254d49d (patch) | |
tree | 2c5ee9f1d37426039ab9c7afc869b1ad0bc5aa02 /src/playlist_state.c | |
parent | b57330cf75bcb339e3f268f1019c63e40d305145 (diff) | |
download | mpd-2fb40fe728ac07574808c40034fc0f3d2254d49d.tar.gz mpd-2fb40fe728ac07574808c40034fc0f3d2254d49d.tar.xz mpd-2fb40fe728ac07574808c40034fc0f3d2254d49d.zip |
playlist_state: add option "restore_paused"
When set, MPD will not auto-start playback on startup; it will be in
"paused" state.
Diffstat (limited to '')
-rw-r--r-- | src/playlist_state.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/playlist_state.c b/src/playlist_state.c index 8f065e6cb..4aa2c2c92 100644 --- a/src/playlist_state.c +++ b/src/playlist_state.c @@ -29,6 +29,7 @@ #include "queue_save.h" #include "path.h" #include "text_file.h" +#include "conf.h" #include <string.h> #include <stdlib.h> @@ -196,6 +197,13 @@ playlist_state_restore(const char *line, FILE *fp, GString *buffer, if (!queue_valid_position(&playlist->queue, current)) current = 0; + if (state == PLAYER_STATE_PLAY && + config_get_bool("restore_paused", false)) + /* the user doesn't want MPD to auto-start + playback after startup; fall back to + "pause" */ + state = PLAYER_STATE_PAUSE; + /* enable all devices for the first time; this must be called here, after the audio output states were restored, before playback begins */ |