Commit 85d952c5 authored by Max Kellermann's avatar Max Kellermann

output: copy reqAudioFormat to outAudioFormat only if not yet open

If the output device is already open, it may have modified outAudioFormat; in this case, outAudioFormat is still valid, and does not need an overwrite.
parent 420c879d
......@@ -34,7 +34,13 @@ int audio_output_open(struct audio_output *audioOutput,
audioOutput->inAudioFormat = *audioFormat;
if (audio_format_defined(&audioOutput->reqAudioFormat)) {
audioOutput->outAudioFormat = audioOutput->reqAudioFormat;
/* copy reqAudioFormat to outAudioFormat only if the
device is not yet open; if it is already open,
plugin->open() may have modified outAudioFormat,
and the value is already ok */
if (!audioOutput->open)
audioOutput->outAudioFormat =
audioOutput->reqAudioFormat;
} else {
audioOutput->outAudioFormat = audioOutput->inAudioFormat;
if (audioOutput->open)
......
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