output_control: close earlier on format mismatch

To prevent a race condition, close the output thread before assigning
the new audio format.
This commit is contained in:
Max Kellermann 2009-03-20 16:21:49 +01:00
parent e6c753a474
commit 3d202e4609

View File

@ -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;