output/Thread: move Enable() call out of Open()

This commit is contained in:
Max Kellermann 2017-06-08 09:41:23 +02:00
parent 669d7a6feb
commit 614df96382

View File

@ -99,9 +99,6 @@ AudioOutput::Open(AudioFormat audio_format, const MusicPipe &pipe)
{
assert(audio_format.IsValid());
/* enable the device (just in case the last enable has failed) */
Enable();
AudioFormat f;
try {
@ -218,6 +215,9 @@ AudioOutputControl::InternalOpen(const AudioFormat audio_format,
skip_delay = true;
try {
/* enable the device (just in case the last enable has failed) */
output->Enable();
output->Open(audio_format, pipe);
} catch (const std::runtime_error &e) {
LogError(e);