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

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

Issue 2425463002: Improve HTMLMediaElement::currentTime() (Closed)
Patch Set: Merge Created 4 years, 1 month 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
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLMediaElement.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp
diff --git a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp
index edd871b1675cf603fd6a88dcff96d588e3124db2..9521cbb0a765b257ccab3117a12986c63d728e37 100644
--- a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp
+++ b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp
@@ -1157,6 +1157,13 @@ bool SourceBuffer::prepareAppend(size_t newDataSize,
bool SourceBuffer::evictCodedFrames(size_t newDataSize) {
DCHECK(m_source);
DCHECK(m_source->mediaElement());
+
+ // Nothing to do if the mediaElement does not yet have frames to evict.
+ if (m_source->mediaElement()->getReadyState() <
+ HTMLMediaElement::kHaveMetadata) {
+ return true;
+ }
+
double currentTime = m_source->mediaElement()->currentTime();
bool result = m_webSourceBuffer->evictCodedFrames(currentTime, newDataSize);
if (!result) {
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLMediaElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698