mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 1698982 - print the error reason and code in 'MediaSource::SetDuration()'. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D108699
This commit is contained in:
parent
824ffd6518
commit
3d61032d37
@ -213,18 +213,21 @@ double MediaSource::Duration() {
|
||||
|
||||
void MediaSource::SetDuration(double aDuration, ErrorResult& aRv) {
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
MSE_API("SetDuration(aDuration=%f, ErrorResult)", aDuration);
|
||||
if (aDuration < 0 || IsNaN(aDuration)) {
|
||||
nsPrintfCString error("Invalid duration value %f", aDuration);
|
||||
MSE_API("SetDuration(aDuration=%f, invalid value)", aDuration);
|
||||
aRv.ThrowTypeError(error);
|
||||
return;
|
||||
}
|
||||
if (mReadyState != MediaSourceReadyState::Open ||
|
||||
mSourceBuffers->AnyUpdating()) {
|
||||
MSE_API("SetDuration(aDuration=%f, invalid state)", aDuration);
|
||||
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
|
||||
return;
|
||||
}
|
||||
DurationChange(aDuration, aRv);
|
||||
MSE_API("SetDuration(aDuration=%f, errorCode=%d)", aDuration,
|
||||
aRv.ErrorCodeAsInt());
|
||||
}
|
||||
|
||||
void MediaSource::SetDuration(double aDuration) {
|
||||
|
Loading…
Reference in New Issue
Block a user