Bug 848954 - Part 28 - Properly stop the driver when shutting down the graph. r=jesup

(this was originaly present, probably caused by a bad rebase)
This commit is contained in:
Paul Adenot 2014-08-26 17:04:38 +02:00
parent 1e9aca6c1d
commit 4d9c2e35fb
2 changed files with 3 additions and 3 deletions

View File

@ -589,8 +589,6 @@ AudioCallbackDriver::StartStream()
void
AudioCallbackDriver::Stop()
{
MOZ_ASSERT(!NS_IsMainThread(), "This is blocking and should not be called on the main thread.");
STREAM_LOG(PR_LOG_DEBUG, ("Stopping audio threads for MediaStreamGraph %p", mGraphImpl));
if (cubeb_stream_stop(mAudioStream) != CUBEB_OK) {
NS_WARNING("Could not stop cubeb stream for MSG.");
}

View File

@ -1450,11 +1450,13 @@ public:
NS_ASSERTION(mGraph->mDetectedNotRunning,
"We should know the graph thread control loop isn't running!");
STREAM_LOG(PR_LOG_DEBUG, ("Shutting down graph %p", mGraph));
if (mGraph->CurrentDriver()->AsAudioCallbackDriver()) {
MOZ_ASSERT(!mGraph->CurrentDriver()->AsAudioCallbackDriver()->InCallback());
}
STREAM_LOG(PR_LOG_DEBUG, ("Shutting drown graph %p", mGraph));
mGraph->CurrentDriver()->Stop();
// mGraph's thread is not running so it's OK to do whatever here
if (mGraph->IsEmpty()) {