Commit f8164a3d authored by Max Kellermann's avatar Max Kellermann

output/Thread: unlock mutex during OpenFilter()

parent c2012659
......@@ -413,6 +413,8 @@ private:
/**
* Throws std::runtime_error on error.
*
* Mutex must not be locked.
*/
AudioFormat OpenFilter(AudioFormat &format);
......
......@@ -148,6 +148,7 @@ AudioOutput::Open()
AudioFormat filter_audio_format;
try {
const ScopeUnlock unlock(mutex);
filter_audio_format = OpenFilter(in_audio_format);
} catch (const std::runtime_error &e) {
FormatError(e, "Failed to open filter for \"%s\" [%s]",
......@@ -263,10 +264,9 @@ AudioOutput::CloseOutput(bool drain)
void
AudioOutput::ReopenFilter()
{
{
const ScopeUnlock unlock(mutex);
CloseFilter();
}
const ScopeUnlock unlock(mutex);
CloseFilter();
try {
OpenFilter(in_audio_format);
......@@ -276,6 +276,7 @@ AudioOutput::ReopenFilter()
"Failed to open filter for \"%s\" [%s]",
name, plugin.name);
const ScopeLock lock(mutex);
Close(false);
}
}
......
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