From 31486446259f7d450b74aae363b53d77ebf54164 Mon Sep 17 00:00:00 2001 From: Alex Chronopoulos Date: Mon, 7 May 2018 19:36:45 +0200 Subject: [PATCH] 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 --- dom/media/GraphDriver.cpp | 1 - dom/media/GraphDriver.h | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dom/media/GraphDriver.cpp b/dom/media/GraphDriver.cpp index 89309ce579a7..fd003ac9dbc6 100644 --- a/dom/media/GraphDriver.cpp +++ b/dom/media/GraphDriver.cpp @@ -1132,7 +1132,6 @@ AudioCallbackDriver::IterationDuration() bool AudioCallbackDriver::IsStarted() { - mGraphImpl->GetMonitor().AssertCurrentThreadOwns(); return mStarted; } diff --git a/dom/media/GraphDriver.h b/dom/media/GraphDriver.h index 64314d545b96..5c085dc36bff 100644 --- a/dom/media/GraphDriver.h +++ b/dom/media/GraphDriver.h @@ -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 mStarted; /* Listener for mic input, if any. */ RefPtr mAudioInput;