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
This commit is contained in:
Andreas Pehrson 2020-10-28 00:58:15 +00:00
Родитель a528f78c44
Коммит b3df0295ce
2 изменённых файлов: 6 добавлений и 17 удалений

Просмотреть файл

@ -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));

Просмотреть файл

@ -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<AudioStreamState> mAudioStreamState;
/* State of the fallback driver, see inline comments. */