output/Thread: unlock mutex during OpenFilter()
This commit is contained in:
parent
c20126598f
commit
f8164a3dd1
|
@ -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();
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue