summaryrefslogtreecommitdiff
path: root/src/output/Thread.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/output/Thread.cxx')
-rw-r--r--src/output/Thread.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/output/Thread.cxx b/src/output/Thread.cxx
index 9a49ab6bd..bf78f3b97 100644
--- a/src/output/Thread.cxx
+++ b/src/output/Thread.cxx
@@ -63,16 +63,20 @@ AudioOutputControl::InternalOpen2(const AudioFormat in_audio_format)
if (open && cf != output->filter_audio_format) {
/* if the filter's output format changes, the output
must be reopened as well */
- output->CloseOutput(true);
open = false;
+
+ const ScopeUnlock unlock(mutex);
+ output->CloseOutput(true);
}
output->filter_audio_format = cf;
if (!open) {
try {
+ const ScopeUnlock unlock(mutex);
output->OpenOutputAndConvert(output->filter_audio_format);
} catch (...) {
+ const ScopeUnlock unlock(mutex);
output->CloseFilter();
throw;
}