Bug 1287244: [MSE] Remove check for not 'updating' in {set,clear}LiveSeekableRange(). r?gerald
See https://github.com/w3c/media-source/issues/118
MozReview-Commit-ID: FtIc1cVfn8R
--- a/dom/media/mediasource/MediaSource.cpp
+++ b/dom/media/mediasource/MediaSource.cpp
@@ -364,57 +364,49 @@ MediaSource::Enabled(JSContext* cx, JSOb
void
MediaSource::SetLiveSeekableRange(double aStart, double aEnd, ErrorResult& aRv)
{
MOZ_ASSERT(NS_IsMainThread());
// 1. If the readyState attribute is not "open" then throw an InvalidStateError
// exception and abort these steps.
- // 2. If the updating attribute equals true on any SourceBuffer in
- // sourceBuffers, then throw an InvalidStateError exception and abort these
- // steps.
- if (mReadyState != MediaSourceReadyState::Open ||
- mSourceBuffers->AnyUpdating()) {
+ if (mReadyState != MediaSourceReadyState::Open) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}
- // 3. If start is negative or greater than end, then throw a TypeError
+ // 2. If start is negative or greater than end, then throw a TypeError
// exception and abort these steps.
if (aStart < 0 || aStart > aEnd) {
aRv.Throw(NS_ERROR_DOM_TYPE_ERR);
return;
}
- // 4. Set live seekable range to be a new normalized TimeRanges object
+ // 3. Set live seekable range to be a new normalized TimeRanges object
// containing a single range whose start position is start and end position is
// end.
mLiveSeekableRange =
Some(media::TimeInterval(media::TimeUnit::FromSeconds(aStart),
media::TimeUnit::FromSeconds(aEnd)));
}
void
MediaSource::ClearLiveSeekableRange(ErrorResult& aRv)
{
MOZ_ASSERT(NS_IsMainThread());
// 1. If the readyState attribute is not "open" then throw an InvalidStateError
// exception and abort these steps.
- // 2. If the updating attribute equals true on any SourceBuffer in
- // sourceBuffers, then throw an InvalidStateError exception and abort these
- // steps.
- if (mReadyState != MediaSourceReadyState::Open ||
- mSourceBuffers->AnyUpdating()) {
+ if (mReadyState != MediaSourceReadyState::Open) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}
- // 3. If live seekable range contains a range, then set live seekable range to
+ // 2. If live seekable range contains a range, then set live seekable range to
// be a new empty TimeRanges object.
mLiveSeekableRange.reset();
}
bool
MediaSource::Attach(MediaSourceDecoder* aDecoder)
{
MOZ_ASSERT(NS_IsMainThread());