output/Thread: unlock mutex during OpenFilter()
This commit is contained in:
src/output
@ -413,6 +413,8 @@ private:
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Throws std::runtime_error on error.
|
* Throws std::runtime_error on error.
|
||||||
|
*
|
||||||
|
* Mutex must not be locked.
|
||||||
*/
|
*/
|
||||||
AudioFormat OpenFilter(AudioFormat &format);
|
AudioFormat OpenFilter(AudioFormat &format);
|
||||||
|
|
||||||
|
@ -148,6 +148,7 @@ AudioOutput::Open()
|
|||||||
|
|
||||||
AudioFormat filter_audio_format;
|
AudioFormat filter_audio_format;
|
||||||
try {
|
try {
|
||||||
|
const ScopeUnlock unlock(mutex);
|
||||||
filter_audio_format = OpenFilter(in_audio_format);
|
filter_audio_format = OpenFilter(in_audio_format);
|
||||||
} catch (const std::runtime_error &e) {
|
} catch (const std::runtime_error &e) {
|
||||||
FormatError(e, "Failed to open filter for \"%s\" [%s]",
|
FormatError(e, "Failed to open filter for \"%s\" [%s]",
|
||||||
@ -263,10 +264,9 @@ AudioOutput::CloseOutput(bool drain)
|
|||||||
void
|
void
|
||||||
AudioOutput::ReopenFilter()
|
AudioOutput::ReopenFilter()
|
||||||
{
|
{
|
||||||
{
|
|
||||||
const ScopeUnlock unlock(mutex);
|
const ScopeUnlock unlock(mutex);
|
||||||
|
|
||||||
CloseFilter();
|
CloseFilter();
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
OpenFilter(in_audio_format);
|
OpenFilter(in_audio_format);
|
||||||
@ -276,6 +276,7 @@ AudioOutput::ReopenFilter()
|
|||||||
"Failed to open filter for \"%s\" [%s]",
|
"Failed to open filter for \"%s\" [%s]",
|
||||||
name, plugin.name);
|
name, plugin.name);
|
||||||
|
|
||||||
|
const ScopeLock lock(mutex);
|
||||||
Close(false);
|
Close(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user