aboutsummaryrefslogtreecommitdiffstats
path: root/src/player_thread.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-10-23 10:55:52 +0200
committerMax Kellermann <max@duempel.org>2009-10-23 10:55:52 +0200
commite53ca368a5448291ca2783b8061727635084618f (patch)
tree596c18606cd386b580a23cc6d07cf121cca8db37 /src/player_thread.c
parentc426a0bc5cc641ecd044c389f7180dad50a355bf (diff)
downloadmpd-e53ca368a5448291ca2783b8061727635084618f.tar.gz
mpd-e53ca368a5448291ca2783b8061727635084618f.tar.xz
mpd-e53ca368a5448291ca2783b8061727635084618f.zip
output_plugin: added methods enable() and disable()
With these methods, an output plugin can allocate some global resources only if it is actually enabled. The method enable() is called after daemonization, which allows for more sophisticated resource allocation during that method.
Diffstat (limited to 'src/player_thread.c')
-rw-r--r--src/player_thread.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/player_thread.c b/src/player_thread.c
index f68f61a04..1794ad404 100644
--- a/src/player_thread.c
+++ b/src/player_thread.c
@@ -350,6 +350,11 @@ static void player_process_command(struct player *player)
case PLAYER_COMMAND_CLOSE_AUDIO:
break;
+ case PLAYER_COMMAND_UPDATE_AUDIO:
+ audio_output_all_enable_disable();
+ player_command_finished();
+ break;
+
case PLAYER_COMMAND_QUEUE:
assert(pc.next_song != NULL);
assert(!player->queued);
@@ -805,6 +810,11 @@ static gpointer player_task(G_GNUC_UNUSED gpointer arg)
break;
+ case PLAYER_COMMAND_UPDATE_AUDIO:
+ audio_output_all_enable_disable();
+ player_command_finished();
+ break;
+
case PLAYER_COMMAND_EXIT:
dc_quit();
audio_output_all_close();