diff options
author | Max Kellermann <max@duempel.org> | 2009-11-03 21:08:48 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2011-01-10 19:46:23 +0100 |
commit | b6995ca0113611613d311250eabfc354658d46a7 (patch) | |
tree | 713bff7fe8b8dcbd48b2ea67f95e3ec9e018104b /src/output_all.c | |
parent | 715844fd089d3baf17d7080b47434fca8fb60b1d (diff) | |
download | mpd-b6995ca0113611613d311250eabfc354658d46a7.tar.gz mpd-b6995ca0113611613d311250eabfc354658d46a7.tar.xz mpd-b6995ca0113611613d311250eabfc354658d46a7.zip |
player_control: removed the global variable "pc"
Allocate a player_control object where needed, and pass it around.
Each "client" object is associated with a "player_control" instance.
This prepares multi-player support.
Diffstat (limited to 'src/output_all.c')
-rw-r--r-- | src/output_all.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/output_all.c b/src/output_all.c index 19c0f0166..8dce9192b 100644 --- a/src/output_all.c +++ b/src/output_all.c @@ -100,7 +100,7 @@ audio_output_config_count(void) } void -audio_output_all_init(void) +audio_output_all_init(struct player_control *pc) { const struct config_param *param = NULL; unsigned int i; @@ -121,7 +121,7 @@ audio_output_all_init(void) /* only allow param to be NULL if there just one audioOutput */ assert(param || (num_audio_outputs == 1)); - if (!audio_output_init(output, param, &error)) { + if (!audio_output_init(output, param, pc, &error)) { if (param != NULL) MPD_ERROR("line %i: %s", param->line, error->message); @@ -473,17 +473,17 @@ audio_output_all_check(void) } bool -audio_output_all_wait(unsigned threshold) +audio_output_all_wait(struct player_control *pc, unsigned threshold) { - player_lock(); + player_lock(pc); if (audio_output_all_check() < threshold) { - player_unlock(); + player_unlock(pc); return true; } - player_wait(); - player_unlock(); + player_wait(pc); + player_unlock(pc); return audio_output_all_check() < threshold; } |