From 3fea624cca7ac5c3499c844ee641f8d283769b95 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 4 Sep 2016 15:09:51 +0200 Subject: [PATCH] output/Thread: use Close() after error in ReopenFilter() Now that CloseFilter() may be called again, we can reduce code duplication. --- src/output/OutputThread.cxx | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/output/OutputThread.cxx b/src/output/OutputThread.cxx index cfc68a877..e98c99244 100644 --- a/src/output/OutputThread.cxx +++ b/src/output/OutputThread.cxx @@ -302,19 +302,7 @@ AudioOutput::ReopenFilter() "Failed to open filter for \"%s\" [%s]", name, plugin.name); - /* this is a little code duplication from Close(), - but we cannot call this function because we must - not call filter_close(filter) again */ - - pipe = nullptr; - - current_chunk = nullptr; - open = false; - fail_timer.Update(); - - mutex.unlock(); - ao_plugin_close(this); - mutex.lock(); + Close(false); return; }