Bug 1861709 align AudioCallbackDriver::ThreadRunning() behavior with its overridden GraphDriver method r=pehrsons

AudioCallbackDriver can have a thread running with a fallback driver or
an audio stream callback.

Asserts are using !ThreadRunning() and so are made stricter by this patch.

Differential Revision: https://phabricator.services.mozilla.com/D192435
This commit is contained in:
Karl Tomlinson 2023-11-02 04:21:30 +00:00
parent e31ee71874
commit ca9f26a192

View File

@ -641,10 +641,11 @@ class AudioCallbackDriver : public GraphDriver, public MixerCallbackReceiver {
return mAudioThreadIdInCb.load() == std::this_thread::get_id();
}
/* Returns true if this audio callback driver has successfully started and not
* yet stopped. If the fallback driver is active, this returns false. */
/* Returns true if this driver has started (perhaps with a fallback driver)
* and not yet stopped. */
bool ThreadRunning() const override {
return mAudioStreamState == AudioStreamState::Running;
return mAudioStreamState == AudioStreamState::Running ||
mFallbackDriverState == FallbackDriverState::Running;
}
/* Whether the underlying cubeb stream has been started and has not stopped