diff options
author | Max Kellermann <max@musicpd.org> | 2017-08-07 17:08:49 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2017-08-07 17:08:49 +0200 |
commit | 4580c685f1fe958842dbaf343158f9f3e0a86f4d (patch) | |
tree | 262cd7fe832e005e2b73087d35b0e1a384b629c8 /src/output/Thread.cxx | |
parent | 67232453d4dae4752f290373dff51bb5161eb737 (diff) |
output/Thread: unlock the mutex for several AudioOutput calls
Diffstat (limited to 'src/output/Thread.cxx')
-rw-r--r-- | src/output/Thread.cxx | 6 |
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; } |