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.
This commit is contained in:
Max Kellermann
2009-10-23 10:55:52 +02:00
parent c426a0bc5c
commit e53ca368a5
15 changed files with 213 additions and 1 deletions

View File

@@ -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();