diff options
author | Max Kellermann <max@duempel.org> | 2009-01-07 23:55:13 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-01-07 23:55:13 +0100 |
commit | bf058f978a51333e3881ad8c046ccc00bff8ef6c (patch) | |
tree | 2cc25534da6adc9c5d8fac9b032f0abda8a1e047 /src/output_control.c | |
parent | 405c102c17bdc0077561dc142c495d47cdf8179d (diff) | |
download | mpd-bf058f978a51333e3881ad8c046ccc00bff8ef6c.tar.gz mpd-bf058f978a51333e3881ad8c046ccc00bff8ef6c.tar.xz mpd-bf058f978a51333e3881ad8c046ccc00bff8ef6c.zip |
output: join the output thread after sending the KILL command
Be sure that the output thread has quite before we start destructing
the output object.
Diffstat (limited to 'src/output_control.c')
-rw-r--r-- | src/output_control.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/output_control.c b/src/output_control.c index 7f2d8ba8d..503001470 100644 --- a/src/output_control.c +++ b/src/output_control.c @@ -134,8 +134,12 @@ void audio_output_close(struct audio_output *audioOutput) void audio_output_finish(struct audio_output *audioOutput) { audio_output_close(audioOutput); - if (audioOutput->thread != NULL) + + if (audioOutput->thread != NULL) { ao_command(audioOutput, AO_COMMAND_KILL); + g_thread_join(audioOutput->thread); + } + if (audioOutput->plugin->finish) audioOutput->plugin->finish(audioOutput->data); if (audioOutput->convBuffer) |