From ecb118f1edab572a904890eddafd3b11c0a79a79 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 8 Oct 2009 15:22:39 +0200 Subject: 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. --- src/output_command.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/output_command.c') diff --git a/src/output_command.c b/src/output_command.c index 5da176dde..9d948c8cc 100644 --- a/src/output_command.c +++ b/src/output_command.c @@ -31,6 +31,8 @@ #include "mixer_control.h" #include "idle.h" +extern unsigned audio_output_state_version; + bool audio_output_enable_index(unsigned idx) { @@ -44,6 +46,8 @@ audio_output_enable_index(unsigned idx) ao->enabled = true; idle_add(IDLE_OUTPUT); + ++audio_output_state_version; + return true; } @@ -67,5 +71,7 @@ audio_output_disable_index(unsigned idx) idle_add(IDLE_MIXER); } + ++audio_output_state_version; + return true; } -- cgit v1.2.3