aboutsummaryrefslogtreecommitdiffstats
path: root/src/output_control.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-03-20 16:21:49 +0100
committerMax Kellermann <max@duempel.org>2009-03-20 16:21:49 +0100
commit3d202e4609ab2ed69f8d906d1af0b273fe5025b3 (patch)
treeec842551ef6b0bb898132a165402384dd227894b /src/output_control.c
parente6c753a474bcf1d81127f74762f8b7f913dd3160 (diff)
downloadmpd-3d202e4609ab2ed69f8d906d1af0b273fe5025b3.tar.gz
mpd-3d202e4609ab2ed69f8d906d1af0b273fe5025b3.tar.xz
mpd-3d202e4609ab2ed69f8d906d1af0b273fe5025b3.zip
output_control: close earlier on format mismatch
To prevent a race condition, close the output thread before assigning the new audio format.
Diffstat (limited to 'src/output_control.c')
-rw-r--r--src/output_control.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/output_control.c b/src/output_control.c
index 9a240ffe4..78800794f 100644
--- a/src/output_control.c
+++ b/src/output_control.c
@@ -79,13 +79,13 @@ audio_output_open(struct audio_output *ao,
ao->chunk = NULL;
if (!ao->config_audio_format) {
+ if (ao->open)
+ audio_output_close(ao);
+
/* no audio format is configured: copy in->out, let
the output's open() method determine the effective
out_audio_format */
ao->out_audio_format = ao->in_audio_format;
-
- if (ao->open)
- audio_output_close(ao);
}
ao->pipe = mp;