output/Control: use Command::OPEN to unpause, remove special case

This commit is contained in:
Max Kellermann 2016-12-21 13:01:38 +01:00
parent a8d343e07b
commit 71c72ed072

View File

@ -115,19 +115,9 @@ AudioOutput::Open(const AudioFormat audio_format, const MusicPipe &mp)
if (open && audio_format == request.audio_format) { if (open && audio_format == request.audio_format) {
assert(&pipe.GetPipe() == &mp || (always_on && pause)); assert(&pipe.GetPipe() == &mp || (always_on && pause));
if (pause) { if (!pause)
pipe.Init(mp); /* already open, already the right parameters
- nothing needs to be done */
/* 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; return true;
} }