Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1128)

Unified Diff: Source/modules/mediasource/SourceBuffer.cpp

Issue 178763006: Enable round-tripping and updating of SourceBuffer timestamp offset (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase and rework so WSB::append() indicates updated timestamp offset Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
+ if (m_webSourceBuffer->append(data, length, &newTimestampOffset))
+ m_timestampOffset = newTimestampOffset;
+}
+
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()

Powered by Google App Engine
This is Rietveld 408576698