Chromium Code Reviews| Index: Source/modules/mediasource/SourceBuffer.cpp |
| diff --git a/Source/modules/mediasource/SourceBuffer.cpp b/Source/modules/mediasource/SourceBuffer.cpp |
| index 3f9bbf97b7ac9d4c9188c45eccb459d9880f1c03..a87c7ddb7ea001f929ba153a32f453ca444d2b9a 100644 |
| --- a/Source/modules/mediasource/SourceBuffer.cpp |
| +++ b/Source/modules/mediasource/SourceBuffer.cpp |
| @@ -483,6 +483,13 @@ void SourceBuffer::scheduleEvent(const AtomicString& eventName) |
| m_asyncEventQueue->enqueueEvent(event.release()); |
| } |
| +void SourceBuffer::appendAndUpdateTimestampOffset(const unsigned char* data, unsigned length) |
| +{ |
| + double newTimestampOffset; |
|
jamesr
2014/02/27 01:49:56
this value is completely unininitialized
wolenetz
2014/02/27 03:29:58
Done.
|
| + if (m_webSourceBuffer->append(data, length, &newTimestampOffset)) |
| + m_timestampOffset = newTimestampOffset; |
|
jamesr
2014/02/27 01:49:56
so if it's used here (i.e. the append() function r
wolenetz
2014/02/27 03:29:58
Done.
|
| +} |
| + |
| void SourceBuffer::appendBufferInternal(const unsigned char* data, unsigned size, ExceptionState& exceptionState) |
| { |
| // Section 3.2 appendBuffer() |
| @@ -534,7 +541,7 @@ void SourceBuffer::appendBufferAsyncPart() |
| // so that it can clear its end of stream state if necessary. |
| m_pendingAppendData.resize(1); |
| } |
| - m_webSourceBuffer->append(m_pendingAppendData.data(), appendSize); |
| + appendAndUpdateTimestampOffset(m_pendingAppendData.data(), appendSize); |
| // 3. Set the updating attribute to false. |
| m_updating = false; |
| @@ -689,7 +696,7 @@ void SourceBuffer::didReceiveDataForClient(const char* data, unsigned dataLength |
| ASSERT(m_updating); |
| ASSERT(m_loader); |
| - m_webSourceBuffer->append(reinterpret_cast<const unsigned char*>(data), dataLength); |
| + appendAndUpdateTimestampOffset(reinterpret_cast<const unsigned char*>(data), dataLength); |
| } |
| void SourceBuffer::didFinishLoading() |