aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder_api.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-01-10 21:27:43 +0100
committerMax Kellermann <max@duempel.org>2011-01-10 21:27:43 +0100
commita0ad96a787d5df3f0cbd0c40252312700320a849 (patch)
tree1d9c66b3880180ae6c7453515aaad7942a8b474a /src/decoder_api.c
parent39c5af5dbc1ccf0b103daaaed642c2d8af3210a8 (diff)
downloadmpd-a0ad96a787d5df3f0cbd0c40252312700320a849.tar.gz
mpd-a0ad96a787d5df3f0cbd0c40252312700320a849.tar.xz
mpd-a0ad96a787d5df3f0cbd0c40252312700320a849.zip
decoder_control: store GCond object, not a player_control
Remove the decoder dependency on player_control. All player_control was needed for is to signal the player thread, and we can do that with a simple GCond as well.
Diffstat (limited to '')
-rw-r--r--src/decoder_api.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/decoder_api.c b/src/decoder_api.c
index ccfbd3df6..8eb296533 100644
--- a/src/decoder_api.c
+++ b/src/decoder_api.c
@@ -21,7 +21,6 @@
#include "decoder_api.h"
#include "decoder_internal.h"
#include "decoder_control.h"
-#include "player_control.h"
#include "audio.h"
#include "song.h"
#include "buffer.h"
@@ -63,10 +62,9 @@ decoder_initialized(struct decoder *decoder,
decoder_lock(dc);
dc->state = DECODE_STATE_DECODE;
+ g_cond_signal(dc->client_cond);
decoder_unlock(dc);
- player_lock_signal(dc->player_control);
-
g_debug("audio_format=%s, seekable=%s",
audio_format_to_string(&dc->in_audio_format, &af_string),
seekable ? "true" : "false");
@@ -115,9 +113,8 @@ decoder_command_finished(struct decoder *decoder)
}
dc->command = DECODE_COMMAND_NONE;
+ g_cond_signal(dc->client_cond);
decoder_unlock(dc);
-
- player_lock_signal(dc->player_control);
}
double decoder_seek_where(G_GNUC_UNUSED struct decoder * decoder)
@@ -214,7 +211,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(decoder->dc->player_control);
+ g_cond_signal(decoder->dc->client_cond);
}
assert(decoder->chunk == NULL);
@@ -329,7 +326,7 @@ decoder_data(struct decoder *decoder,
if (dest == NULL) {
/* the chunk is full, flush it */
decoder_flush_chunk(decoder);
- player_lock_signal(dc->player_control);
+ g_cond_signal(dc->client_cond);
continue;
}
@@ -348,7 +345,7 @@ decoder_data(struct decoder *decoder,
if (full) {
/* the chunk is full, flush it */
decoder_flush_chunk(decoder);
- player_lock_signal(dc->player_control);
+ g_cond_signal(dc->client_cond);
}
data += nbytes;
@@ -432,7 +429,7 @@ decoder_replay_gain(struct decoder *decoder,
replay gain values affect the following
samples */
decoder_flush_chunk(decoder);
- player_lock_signal(decoder->dc->player_control);
+ g_cond_signal(decoder->dc->client_cond);
}
} else
decoder->replay_gain_serial = 0;