aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder_api.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-11-03 21:08:48 +0100
committerMax Kellermann <max@duempel.org>2011-01-10 19:46:23 +0100
commitb6995ca0113611613d311250eabfc354658d46a7 (patch)
tree713bff7fe8b8dcbd48b2ea67f95e3ec9e018104b /src/decoder_api.c
parent715844fd089d3baf17d7080b47434fca8fb60b1d (diff)
downloadmpd-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 '')
-rw-r--r--src/decoder_api.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/decoder_api.c b/src/decoder_api.c
index fe34ea34a..ccfbd3df6 100644
--- a/src/decoder_api.c
+++ b/src/decoder_api.c
@@ -65,7 +65,7 @@ decoder_initialized(struct decoder *decoder,
dc->state = DECODE_STATE_DECODE;
decoder_unlock(dc);
- player_lock_signal();
+ player_lock_signal(dc->player_control);
g_debug("audio_format=%s, seekable=%s",
audio_format_to_string(&dc->in_audio_format, &af_string),
@@ -117,7 +117,7 @@ decoder_command_finished(struct decoder *decoder)
dc->command = DECODE_COMMAND_NONE;
decoder_unlock(dc);
- player_lock_signal();
+ player_lock_signal(dc->player_control);
}
double decoder_seek_where(G_GNUC_UNUSED struct decoder * decoder)
@@ -214,7 +214,7 @@ do_send_tag(struct decoder *decoder, struct input_stream *is,
/* there is a partial chunk - flush it, we want the
tag in a new chunk */
decoder_flush_chunk(decoder);
- player_lock_signal();
+ player_lock_signal(decoder->dc->player_control);
}
assert(decoder->chunk == NULL);
@@ -329,7 +329,7 @@ decoder_data(struct decoder *decoder,
if (dest == NULL) {
/* the chunk is full, flush it */
decoder_flush_chunk(decoder);
- player_lock_signal();
+ player_lock_signal(dc->player_control);
continue;
}
@@ -348,7 +348,7 @@ decoder_data(struct decoder *decoder,
if (full) {
/* the chunk is full, flush it */
decoder_flush_chunk(decoder);
- player_lock_signal();
+ player_lock_signal(dc->player_control);
}
data += nbytes;
@@ -432,7 +432,7 @@ decoder_replay_gain(struct decoder *decoder,
replay gain values affect the following
samples */
decoder_flush_chunk(decoder);
- player_lock_signal();
+ player_lock_signal(decoder->dc->player_control);
}
} else
decoder->replay_gain_serial = 0;