aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder_thread.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-12-28 19:48:53 +0100
committerMax Kellermann <max@duempel.org>2008-12-28 19:48:53 +0100
commit8fe03b8bcef9f5a3a822055a3c4ab65cfe1baedb (patch)
treeddb22a695b4a2643cbf77e699e2d5a5f0cbcd2ab /src/decoder_thread.c
parentc01aa53e6a972cd83e866b6b2e390449f2a59658 (diff)
downloadmpd-8fe03b8bcef9f5a3a822055a3c4ab65cfe1baedb.tar.gz
mpd-8fe03b8bcef9f5a3a822055a3c4ab65cfe1baedb.tar.xz
mpd-8fe03b8bcef9f5a3a822055a3c4ab65cfe1baedb.zip
decoder: terminate decoder thread before MPD cleanup
When MPD exits, it should manually free all resources in use, to allow easy memory leak debugging. Make the decoder thread terminate during that.
Diffstat (limited to 'src/decoder_thread.c')
-rw-r--r--src/decoder_thread.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/decoder_thread.c b/src/decoder_thread.c
index 0ae1a88f9..2be0937da 100644
--- a/src/decoder_thread.c
+++ b/src/decoder_thread.c
@@ -204,7 +204,7 @@ static void decoder_run(void)
static void * decoder_task(G_GNUC_UNUSED void *arg)
{
- while (1) {
+ do {
assert(dc.state == DECODE_STATE_STOP ||
dc.state == DECODE_STATE_ERROR);
@@ -226,7 +226,7 @@ static void * decoder_task(G_GNUC_UNUSED void *arg)
notify_wait(&dc.notify);
break;
}
- }
+ } while (dc.command != DECODE_COMMAND_NONE || !dc.quit);
return NULL;
}