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.
This commit is contained in:
Max Kellermann
2009-11-03 21:08:48 +01:00
parent 715844fd08
commit b6995ca011
42 changed files with 753 additions and 583 deletions

View File

@@ -28,8 +28,9 @@
#define G_LOG_DOMAIN "decoder_control"
void
dc_init(struct decoder_control *dc)
dc_init(struct decoder_control *dc, struct player_control *pc)
{
dc->player_control = pc;
dc->thread = NULL;
dc->mutex = g_mutex_new();
@@ -62,7 +63,7 @@ static void
dc_command_wait_locked(struct decoder_control *dc)
{
while (dc->command != DECODE_COMMAND_NONE)
player_wait_decoder(dc);
player_wait_decoder(dc->player_control, dc);
}
void