Bug 1457427 - Change the assert in SetInputListener of GraphDriver to verify that the driver is not started. r=padenot

With the updated OnThread method SetInputListener method cannot continue asserting for being in audio callback. This check is not realistic since it is used on a newly created driver before being started.

MozReview-Commit-ID: 5gntuHm3fnr

--HG--
extra : rebase_source : e3bc17e9d8c83c4d61686889af41edfb3ef3902f
This commit is contained in:
Alex Chronopoulos 2018-05-07 19:36:45 +02:00
parent ea082741ae
commit 3148644625
2 changed files with 2 additions and 3 deletions

View File

@ -1132,7 +1132,6 @@ AudioCallbackDriver::IterationDuration()
bool
AudioCallbackDriver::IsStarted() {
mGraphImpl->GetMonitor().AssertCurrentThreadOwns();
return mStarted;
}

View File

@ -425,7 +425,7 @@ public:
// These are invoked on the MSG thread (we don't call this if not LIFECYCLE_RUNNING)
virtual void SetInputListener(AudioDataListener *aListener) {
MOZ_ASSERT(OnThread());
MOZ_ASSERT(!IsStarted());
mAudioInput = aListener;
}
// XXX do we need the param? probably no
@ -529,7 +529,7 @@ private:
* driver back to a SystemClockDriver).
* This is synchronized by the Graph's monitor.
* */
bool mStarted;
Atomic<bool> mStarted;
/* Listener for mic input, if any. */
RefPtr<AudioDataListener> mAudioInput;