aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder_control.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-01-25 13:44:27 +0100
committerMax Kellermann <max@duempel.org>2009-01-25 13:44:27 +0100
commitac0e799965afef198e3cba1eb11f018cae680ac3 (patch)
treed63667b1e2f26a4b1b29d1f2724fae7504a6ed0e /src/decoder_control.c
parent2c45224be72e06463ddd48956ecaef61da9dfecb (diff)
downloadmpd-ac0e799965afef198e3cba1eb11f018cae680ac3.tar.gz
mpd-ac0e799965afef198e3cba1eb11f018cae680ac3.tar.xz
mpd-ac0e799965afef198e3cba1eb11f018cae680ac3.zip
decoder_control: added decoder_control.thread
decoder_control.thread contains the handle of the decoder thread, or NULL if the decoder thread isn't running.
Diffstat (limited to '')
-rw-r--r--src/decoder_control.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/decoder_control.c b/src/decoder_control.c
index b934d516f..6d2efd0d7 100644
--- a/src/decoder_control.c
+++ b/src/decoder_control.c
@@ -102,8 +102,13 @@ dc_seek(struct notify *notify, double where)
}
void
-dc_quit(struct notify *notify)
+dc_quit(void)
{
+ assert(dc.thread != NULL);
+
dc.quit = true;
- dc_command(notify, DECODE_COMMAND_STOP);
+ dc_command_async(DECODE_COMMAND_STOP);
+
+ g_thread_join(dc.thread);
+ dc.thread = NULL;
}