From 41fd583fbcfacdfc0956991c40a9165362acf95b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 13 Dec 2016 21:57:03 +0100 Subject: [PATCH] output/Thread: eliminate one ScopeLock --- src/output/OutputThread.cxx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/output/OutputThread.cxx b/src/output/OutputThread.cxx index 6f990790e..499cb9583 100644 --- a/src/output/OutputThread.cxx +++ b/src/output/OutputThread.cxx @@ -261,11 +261,9 @@ AudioOutput::CloseOutput(bool drain) void AudioOutput::ReopenFilter() { - const ScopeUnlock unlock(mutex); - - CloseFilter(); - try { + const ScopeUnlock unlock(mutex); + CloseFilter(); OpenFilter(in_audio_format); convert_filter_set(convert_filter.Get(), out_audio_format); } catch (const std::runtime_error &e) { @@ -273,7 +271,6 @@ AudioOutput::ReopenFilter() "Failed to open filter for \"%s\" [%s]", name, plugin.name); - const ScopeLock lock(mutex); Close(false); } }