From 6e643fe58b5329e109c781d0b5bcddf7ff0a8780 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 13 Dec 2016 20:28:19 +0100 Subject: [PATCH] output/Thread: don't deinitialize the pipe in Close() --- src/output/OutputThread.cxx | 7 ++----- src/output/SharedPipeConsumer.hxx | 5 ----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/output/OutputThread.cxx b/src/output/OutputThread.cxx index 2746e6699..5566c8f17 100644 --- a/src/output/OutputThread.cxx +++ b/src/output/OutputThread.cxx @@ -237,7 +237,7 @@ AudioOutput::Close(bool drain) { assert(open); - pipe.Deinit(); + pipe.Cancel(); open = false; @@ -288,11 +288,8 @@ void AudioOutput::Reopen() { if (!config_audio_format.IsFullyDefined()) { - if (open) { - const MusicPipe &old_pipe = pipe.GetPipe(); + if (open) Close(true); - pipe.Init(old_pipe); - } /* no audio format is configured: copy in->out, let the output's open() method determine the effective diff --git a/src/output/SharedPipeConsumer.hxx b/src/output/SharedPipeConsumer.hxx index fe5039901..d53824077 100644 --- a/src/output/SharedPipeConsumer.hxx +++ b/src/output/SharedPipeConsumer.hxx @@ -56,11 +56,6 @@ public: chunk = nullptr; } - void Deinit() { - pipe = nullptr; - chunk = nullptr; - } - const MusicPipe &GetPipe() { assert(pipe != nullptr);