зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1565317 - Handle missing mMediaSource in ReduceConstraint. r=jib
Differential Revision: https://phabricator.services.mozilla.com/D37778 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
5ea23033d2
Коммит
83ae7ef921
|
@ -2289,10 +2289,17 @@ static void ReduceConstraint(
|
|||
}
|
||||
|
||||
// Keep mediaSource, ignore all other constraints.
|
||||
auto& c = aConstraint.GetAsMediaTrackConstraints();
|
||||
MOZ_DIAGNOSTIC_ASSERT(c.mMediaSource.WasPassed());
|
||||
nsString mediaSource = c.mMediaSource.Value();
|
||||
aConstraint.SetAsMediaTrackConstraints().mMediaSource.Construct(mediaSource);
|
||||
Maybe<nsString> mediaSource;
|
||||
if (aConstraint.GetAsMediaTrackConstraints().mMediaSource.WasPassed()) {
|
||||
mediaSource =
|
||||
Some(aConstraint.GetAsMediaTrackConstraints().mMediaSource.Value());
|
||||
}
|
||||
if (mediaSource) {
|
||||
aConstraint.SetAsMediaTrackConstraints().mMediaSource.Value() =
|
||||
*mediaSource;
|
||||
} else {
|
||||
aConstraint.SetAsMediaTrackConstraints();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче