From 3d202e4609ab2ed69f8d906d1af0b273fe5025b3 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 20 Mar 2009 16:21:49 +0100 Subject: output_control: close earlier on format mismatch To prevent a race condition, close the output thread before assigning the new audio format. --- src/output_control.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') 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; -- cgit v1.2.3