diff --git a/dom/media/MediaTrackGraph.cpp b/dom/media/MediaTrackGraph.cpp index 66a2c90c2f70..f9981c42108f 100644 --- a/dom/media/MediaTrackGraph.cpp +++ b/dom/media/MediaTrackGraph.cpp @@ -125,7 +125,7 @@ TrackTime MediaTrackGraphImpl::GraphTimeToTrackTimeWithBlocking( } GraphTime MediaTrackGraphImpl::IterationEnd() const { - MOZ_ASSERT(OnGraphThreadOrNotRunning()); + MOZ_ASSERT(OnGraphThread()); return CurrentDriver()->IterationEnd(); } @@ -676,7 +676,7 @@ nsresult MediaTrackGraphImpl::OpenAudioInput(CubebUtils::AudioDeviceID aID, void MediaTrackGraphImpl::CloseAudioInputImpl( Maybe& aID, AudioDataListener* aListener) { - MOZ_ASSERT(OnGraphThreadOrNotRunning()); + MOZ_ASSERT(OnGraphThread()); // It is possible to not know the ID here, find it first. if (aID.isNothing()) { for (auto iter = mInputDeviceUsers.Iter(); !iter.Done(); iter.Next()) { diff --git a/dom/media/MediaTrackGraphImpl.h b/dom/media/MediaTrackGraphImpl.h index cda8674b4135..e8e73b48a9b7 100644 --- a/dom/media/MediaTrackGraphImpl.h +++ b/dom/media/MediaTrackGraphImpl.h @@ -854,6 +854,8 @@ class MediaTrackGraphImpl : public MediaTrackGraph, #if DEBUG if (mGraphDriverRunning) { mMonitor.AssertCurrentThreadOwns(); + } else { + MOZ_ASSERT(NS_IsMainThread()); } #endif return mLifecycleState; @@ -862,6 +864,8 @@ class MediaTrackGraphImpl : public MediaTrackGraph, #if DEBUG if (mGraphDriverRunning) { mMonitor.AssertCurrentThreadOwns(); + } else { + MOZ_ASSERT(NS_IsMainThread()); } #endif return mLifecycleState;