output/Thread: unlock the mutex for several AudioOutput calls
This commit is contained in:
@@ -63,16 +63,20 @@ AudioOutputControl::InternalOpen2(const AudioFormat in_audio_format)
|
|||||||
if (open && cf != output->filter_audio_format) {
|
if (open && cf != output->filter_audio_format) {
|
||||||
/* if the filter's output format changes, the output
|
/* if the filter's output format changes, the output
|
||||||
must be reopened as well */
|
must be reopened as well */
|
||||||
output->CloseOutput(true);
|
|
||||||
open = false;
|
open = false;
|
||||||
|
|
||||||
|
const ScopeUnlock unlock(mutex);
|
||||||
|
output->CloseOutput(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
output->filter_audio_format = cf;
|
output->filter_audio_format = cf;
|
||||||
|
|
||||||
if (!open) {
|
if (!open) {
|
||||||
try {
|
try {
|
||||||
|
const ScopeUnlock unlock(mutex);
|
||||||
output->OpenOutputAndConvert(output->filter_audio_format);
|
output->OpenOutputAndConvert(output->filter_audio_format);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
|
const ScopeUnlock unlock(mutex);
|
||||||
output->CloseFilter();
|
output->CloseFilter();
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user