aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-10-24 00:28:58 +0200
committerMax Kellermann <max@duempel.org>2014-10-24 00:29:03 +0200
commit8fc3768166264b7c858df6d910fa910ca3549a96 (patch)
tree28c02255994ee42c231ac82163b53ebeb8ec8b47
parentb07bddf742ee36d30828efd5bd80c9dee33e1bc4 (diff)
downloadmpd-8fc3768166264b7c858df6d910fa910ca3549a96.tar.gz
mpd-8fc3768166264b7c858df6d910fa910ca3549a96.tar.xz
mpd-8fc3768166264b7c858df6d910fa910ca3549a96.zip
OutputThread: unlock mutex for CloseFilter()
Be consistent.
-rw-r--r--src/output/Internal.hxx5
-rw-r--r--src/output/OutputThread.cxx9
2 files changed, 14 insertions, 0 deletions
diff --git a/src/output/Internal.hxx b/src/output/Internal.hxx
index 658ebd4e1..6e6ffb442 100644
--- a/src/output/Internal.hxx
+++ b/src/output/Internal.hxx
@@ -383,7 +383,12 @@ private:
void Reopen();
AudioFormat OpenFilter(AudioFormat &format, Error &error_r);
+
+ /**
+ * Mutex must not be locked.
+ */
void CloseFilter();
+
void ReopenFilter();
/**
diff --git a/src/output/OutputThread.cxx b/src/output/OutputThread.cxx
index e46425097..d26b2da67 100644
--- a/src/output/OutputThread.cxx
+++ b/src/output/OutputThread.cxx
@@ -174,7 +174,10 @@ AudioOutput::Open()
FormatError(error, "Failed to open \"%s\" [%s]",
name, plugin.name);
+ mutex.unlock();
CloseFilter();
+ mutex.lock();
+
fail_timer.Update();
return;
}
@@ -184,7 +187,10 @@ AudioOutput::Open()
FormatError(error, "Failed to convert for \"%s\" [%s]",
name, plugin.name);
+ mutex.unlock();
CloseFilter();
+ mutex.lock();
+
fail_timer.Update();
return;
}
@@ -233,7 +239,10 @@ AudioOutput::ReopenFilter()
{
Error error;
+ mutex.unlock();
CloseFilter();
+ mutex.lock();
+
const AudioFormat filter_audio_format =
OpenFilter(in_audio_format, error);
if (!filter_audio_format.IsDefined() ||