output/Thread: move code to InternalDisable()

This commit is contained in:
Max Kellermann 2017-06-08 09:32:07 +02:00
parent ae713cb099
commit d600b937f1
2 changed files with 13 additions and 2 deletions

View File

@ -360,6 +360,11 @@ public:
void LockAllowPlay() noexcept;
private:
/**
* Runs inside the OutputThread. Handles exceptions.
*/
void InternalDisable() noexcept;
/**
* Runs inside the OutputThread. Handles exceptions.
*/

View File

@ -203,6 +203,12 @@ AudioOutput::OpenOutputAndConvert(AudioFormat desired_audio_format)
}
}
inline void
AudioOutputControl::InternalDisable() noexcept
{
output->Disable();
}
inline void
AudioOutputControl::InternalOpen(const AudioFormat audio_format,
const MusicPipe &pipe) noexcept
@ -467,7 +473,7 @@ AudioOutputControl::Task()
break;
case Command::DISABLE:
output->Disable();
InternalDisable();
CommandFinished();
break;
@ -520,7 +526,7 @@ AudioOutputControl::Task()
continue;
case Command::KILL:
output->Disable();
InternalDisable();
output->source.Cancel();
CommandFinished();
return;