output/MultipleOutputs: add method IsOpen()

This commit is contained in:
Max Kellermann 2019-09-26 14:52:19 +02:00
parent f616bfe354
commit 2f3e94f8d0
2 changed files with 10 additions and 1 deletions

View File

@ -172,7 +172,7 @@ MultipleOutputs::Update(bool force) noexcept
{
bool ret = false;
if (!input_audio_format.IsDefined())
if (!IsOpen())
return false;
for (const auto &ao : outputs)

View File

@ -155,6 +155,15 @@ public:
void SetSoftwareVolume(unsigned volume) noexcept;
private:
/**
* Was Open() called successfully?
*
* This method may only be called from the player thread.
*/
bool IsOpen() const noexcept {
return input_audio_format.IsDefined();
}
/**
* Wait until all (active) outputs have finished the current
* command.