зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1517711 - Guard other uses of SetPullingEnabled too. r=padenot
Depends on D15892 Differential Revision: https://phabricator.services.mozilla.com/D15896 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
72327b88f5
Коммит
6f2800844c
|
@ -4193,7 +4193,8 @@ SourceListener::InitializeAsync() {
|
|||
state->mTrackEnabled = true;
|
||||
state->mTrackEnabledTime = TimeStamp::Now();
|
||||
|
||||
if (state == mVideoDeviceState.get()) {
|
||||
if (state == mVideoDeviceState.get() &&
|
||||
!mStream->IsDestroyed()) {
|
||||
mStream->SetPullingEnabled(kVideoTrack, true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -461,6 +461,9 @@ nsresult MediaEngineDefaultAudioSource::Start(
|
|||
|
||||
NS_DispatchToMainThread(
|
||||
NS_NewRunnableFunction(__func__, [stream = mStream, track = mTrackID]() {
|
||||
if (stream->IsDestroyed()) {
|
||||
return;
|
||||
}
|
||||
stream->SetPullingEnabled(track, true);
|
||||
}));
|
||||
|
||||
|
@ -484,6 +487,9 @@ nsresult MediaEngineDefaultAudioSource::Stop(
|
|||
|
||||
NS_DispatchToMainThread(
|
||||
NS_NewRunnableFunction(__func__, [stream = mStream, track = mTrackID]() {
|
||||
if (stream->IsDestroyed()) {
|
||||
return;
|
||||
}
|
||||
stream->SetPullingEnabled(track, false);
|
||||
}));
|
||||
return NS_OK;
|
||||
|
|
|
@ -1475,16 +1475,22 @@ class GenericReceiveListener : public MediaStreamTrackListener {
|
|||
}
|
||||
|
||||
void AddSelf() {
|
||||
if (!mListening) {
|
||||
if (mListening) {
|
||||
return;
|
||||
}
|
||||
mListening = true;
|
||||
mSource->SetPullingEnabled(mTrackId, true);
|
||||
mMaybeTrackNeedsUnmute = true;
|
||||
if (!mSource->IsDestroyed()) {
|
||||
mSource->SetPullingEnabled(mTrackId, true);
|
||||
}
|
||||
}
|
||||
|
||||
void RemoveSelf() {
|
||||
if (mListening) {
|
||||
if (!mListening) {
|
||||
return;
|
||||
}
|
||||
mListening = false;
|
||||
if (!mSource->IsDestroyed()) {
|
||||
mSource->SetPullingEnabled(mTrackId, false);
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче