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; void LockAllowPlay() noexcept;
private: private:
/**
* Runs inside the OutputThread. Handles exceptions.
*/
void InternalDisable() noexcept;
/** /**
* Runs inside the OutputThread. Handles exceptions. * 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 inline void
AudioOutputControl::InternalOpen(const AudioFormat audio_format, AudioOutputControl::InternalOpen(const AudioFormat audio_format,
const MusicPipe &pipe) noexcept const MusicPipe &pipe) noexcept
@@ -467,7 +473,7 @@ AudioOutputControl::Task()
break; break;
case Command::DISABLE: case Command::DISABLE:
output->Disable(); InternalDisable();
CommandFinished(); CommandFinished();
break; break;
@@ -520,7 +526,7 @@ AudioOutputControl::Task()
continue; continue;
case Command::KILL: case Command::KILL:
output->Disable(); InternalDisable();
output->source.Cancel(); output->source.Cancel();
CommandFinished(); CommandFinished();
return; return;