aboutsummaryrefslogtreecommitdiffstats
path: root/src/output_state.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-10-08 15:22:39 +0200
committerMax Kellermann <max@duempel.org>2009-10-08 15:22:39 +0200
commitecb118f1edab572a904890eddafd3b11c0a79a79 (patch)
tree4e273cd64778fcff80250b3b33ffb050a257c981 /src/output_state.c
parent1e663b186998ffdeef9b3b9775558e9378bad342 (diff)
downloadmpd-ecb118f1edab572a904890eddafd3b11c0a79a79.tar.gz
mpd-ecb118f1edab572a904890eddafd3b11c0a79a79.tar.xz
mpd-ecb118f1edab572a904890eddafd3b11c0a79a79.zip
state_file: save only if something has changed
If nothing has changed since the last save, don't save the state file. Saving will spin up the hard drive, which is undesirable on hosts where MPD is idling in background.
Diffstat (limited to 'src/output_state.c')
-rw-r--r--src/output_state.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/output_state.c b/src/output_state.c
index 7fc60518c..be135f6d0 100644
--- a/src/output_state.c
+++ b/src/output_state.c
@@ -34,6 +34,8 @@
#define AUDIO_DEVICE_STATE "audio_device_state:"
+unsigned audio_output_state_version;
+
void
audio_output_state_save(FILE *fp)
{
@@ -80,3 +82,9 @@ audio_output_state_read(const char *line)
ao->enabled = false;
return true;
}
+
+unsigned
+audio_output_state_get_version(void)
+{
+ return audio_output_state_version;
+}