From 71c72ed072249e8ca6984d4ee5f9f8b70faa631c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 21 Dec 2016 13:01:38 +0100 Subject: [PATCH] output/Control: use Command::OPEN to unpause, remove special case --- src/output/OutputControl.cxx | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/output/OutputControl.cxx b/src/output/OutputControl.cxx index 74a1765d5..e8a02dbda 100644 --- a/src/output/OutputControl.cxx +++ b/src/output/OutputControl.cxx @@ -115,20 +115,10 @@ AudioOutput::Open(const AudioFormat audio_format, const MusicPipe &mp) if (open && audio_format == request.audio_format) { assert(&pipe.GetPipe() == &mp || (always_on && pause)); - if (pause) { - pipe.Init(mp); - - /* unpause with the CANCEL command; this is a - hack, but suits well for forcing the thread - to leave the ao_pause() thread, and we need - to flush the device buffer anyway */ - - /* we're not using audio_output_cancel() here, - because that function is asynchronous */ - CommandWait(Command::CANCEL); - } - - return true; + if (!pause) + /* already open, already the right parameters + - nothing needs to be done */ + return true; } request.audio_format = audio_format;