From b3df0295ceca1f5c7b6bed57509aa456161f248b Mon Sep 17 00:00:00 2001 From: Andreas Pehrson Date: Wed, 28 Oct 2020 00:58:15 +0000 Subject: [PATCH] Bug 1657246 - Back out bug 1632864's fix. r=padenot This keeps the gtest from bug 1632864, but reverts the fixes for a second take. Differential Revision: https://phabricator.services.mozilla.com/D94562 --- dom/media/GraphDriver.cpp | 18 +++++------------- dom/media/GraphDriver.h | 5 +---- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/dom/media/GraphDriver.cpp b/dom/media/GraphDriver.cpp index cbf15b75d00e..41efe71f89fe 100644 --- a/dom/media/GraphDriver.cpp +++ b/dom/media/GraphDriver.cpp @@ -423,9 +423,7 @@ class AudioCallbackDriver::FallbackWrapper : public GraphInterface { "The audio driver can only enter stopping if it iterated the " "graph, which it can only do if there's no fallback driver"); if (audioState != AudioStreamState::Running && result.IsStillProcessing()) { - if (audioState != AudioStreamState::Errored) { - mOwner->MaybeStartAudioStream(); - } + mOwner->MaybeStartAudioStream(); return result; } @@ -1061,12 +1059,11 @@ void AudioCallbackDriver::StateCallback(cubeb_state aState) { LOG(LogLevel::Debug, ("AudioCallbackDriver(%p) State: %s", this, StateToString(aState))); - // Clear the flag for the not running and error states (stopped, drained) + // Clear the flag for the not running + // states: stopped, drained, error. AudioStreamState streamState = mAudioStreamState.exchange( - aState == CUBEB_STATE_STARTED - ? AudioStreamState::Running - : aState == CUBEB_STATE_ERROR ? AudioStreamState::Errored - : AudioStreamState::None); + aState == CUBEB_STATE_STARTED ? AudioStreamState::Running + : AudioStreamState::None); if (aState == CUBEB_STATE_ERROR) { // About to hand over control of the graph. Do not start a new driver if @@ -1208,7 +1205,6 @@ TimeDuration AudioCallbackDriver::AudioOutputLatency() { void AudioCallbackDriver::FallbackToSystemClockDriver() { MOZ_ASSERT(!ThreadRunning()); MOZ_ASSERT(mAudioStreamState == AudioStreamState::None || - mAudioStreamState == AudioStreamState::Errored || mAudioStreamState == AudioStreamState::Pending); MOZ_ASSERT(mFallbackDriverState == FallbackDriverState::None); LOG(LogLevel::Debug, @@ -1252,10 +1248,6 @@ void AudioCallbackDriver::FallbackDriverStopped(GraphTime aIterationStart, void AudioCallbackDriver::MaybeStartAudioStream() { AudioStreamState streamState = mAudioStreamState; - MOZ_ASSERT( - streamState != AudioStreamState::Errored, - "An errored stream must not attempted to be re-started, an error stream" - " has already beed started once"); if (streamState != AudioStreamState::None) { LOG(LogLevel::Verbose, ("%p: AudioCallbackDriver %p Cannot re-init.", Graph(), this)); diff --git a/dom/media/GraphDriver.h b/dom/media/GraphDriver.h index 57dafdb84e7b..1d8d55e6d122 100644 --- a/dom/media/GraphDriver.h +++ b/dom/media/GraphDriver.h @@ -750,10 +750,7 @@ class AudioCallbackDriver : public GraphDriver, /* There is a running AudioStream. */ Running, /* There is an AudioStream that is draining, and will soon stop. */ - Stopping, - /* There is an AudioStream that has errored, the Fallback driver needs to - * continue advancing the graph. */ - Errored, + Stopping }; Atomic mAudioStreamState; /* State of the fallback driver, see inline comments. */