Index: Source/modules/mediasource/SourceBuffer.cpp |
diff --git a/Source/modules/mediasource/SourceBuffer.cpp b/Source/modules/mediasource/SourceBuffer.cpp |
index e44acdd05d626cece4f1c5cec1854f1354e93d36..066ba8e8d5dc19d8c32cd4d95ad9f42ea7f53616 100644 |
--- a/Source/modules/mediasource/SourceBuffer.cpp |
+++ b/Source/modules/mediasource/SourceBuffer.cpp |
@@ -513,7 +513,12 @@ void SourceBuffer::appendBufferInternal(const unsigned char* data, unsigned size |
// 3. If the readyState attribute of the parent media source is in the "ended" state then run the following steps: ... |
m_source->openIfInEndedState(); |
- // Steps 4-5 - end "prepare append" algorithm. |
+ // 4. Run the coded frame eviction algorithm. |
+ if (!evictCodedFrames()) { |
+ // 5. If the buffer full flag equals true, then throw a QUOTA_EXCEEDED_ERR exception and abort these steps. |
philipj_slow
2014/12/10 09:28:26
I see that we don't have an explicit "buffer full
kjoswiak
2014/12/10 19:11:45
Though other thing I considered doing is adding a
|
+ exceptionState.throwDOMException(QuotaExceededError, "The SourceBuffer is full, and cannot free space append additional buffers."); |
philipj_slow
2014/12/10 09:28:26
missing "to"
kjoswiak
2014/12/10 19:11:45
Done.
|
+ return; |
+ } |
// 2. Add data to the end of the input buffer. |
ASSERT(data || size == 0); |
@@ -611,6 +616,11 @@ void SourceBuffer::removeAsyncPart() |
scheduleEvent(EventTypeNames::updateend); |
} |
+bool SourceBuffer::evictCodedFrames() |
+{ |
+ return m_webSourceBuffer->evictCodedFrames(); |
+} |
+ |
void SourceBuffer::appendStreamInternal(PassRefPtrWillBeRawPtr<Stream> stream, ExceptionState& exceptionState) |
{ |
// Section 3.2 appendStream() |
@@ -634,7 +644,13 @@ void SourceBuffer::appendStreamInternal(PassRefPtrWillBeRawPtr<Stream> stream, E |
// 3. If the readyState attribute of the parent media source is in the "ended" state then run the following steps: ... |
m_source->openIfInEndedState(); |
- // Steps 4-5 of the prepare append algorithm are handled by m_webSourceBuffer. |
+ // 4. Run the coded frame eviction algorithm. |
+ if (!evictCodedFrames()) { |
+ // 5. If the buffer full flag equals true, then throw a QUOTA_EXCEEDED_ERR exception and abort these steps. |
+ // TODO(kjoswiak): Is this accurate? Are we actually appending data, or appending a data source? |
philipj_slow
2014/12/10 09:28:26
No TODO(user) in Blink, just FIXME. Even better, i
kjoswiak
2014/12/10 19:11:45
whoops meant to remove this, I had actually come t
|
+ exceptionState.throwDOMException(QuotaExceededError, "The SourceBuffer is full, and cannot free space to append stream."); |
+ return; |
+ } |
// 2. Set the updating attribute to true. |
m_updating = true; |