Commit 3d202e46 authored by Max Kellermann's avatar Max Kellermann

output_control: close earlier on format mismatch

To prevent a race condition, close the output thread before assigning the new audio format.
parent e6c753a4
...@@ -79,13 +79,13 @@ audio_output_open(struct audio_output *ao, ...@@ -79,13 +79,13 @@ audio_output_open(struct audio_output *ao,
ao->chunk = NULL; ao->chunk = NULL;
if (!ao->config_audio_format) { if (!ao->config_audio_format) {
if (ao->open)
audio_output_close(ao);
/* no audio format is configured: copy in->out, let /* no audio format is configured: copy in->out, let
the output's open() method determine the effective the output's open() method determine the effective
out_audio_format */ out_audio_format */
ao->out_audio_format = ao->in_audio_format; ao->out_audio_format = ao->in_audio_format;
if (ao->open)
audio_output_close(ao);
} }
ao->pipe = mp; ao->pipe = mp;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment