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

Unified Diff: Source/core/html/HTMLMediaElement.cpp

Issue 235953010: Resolve the issue of unexpected currentTime values when setting currentTime from seeking event (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@mediaposter
Patch Set: Created 6 years, 8 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/core/html/HTMLMediaElement.cpp
diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp
index 4da8ea7bc447051a7ee714c4d5aff3c817e1cfc7..381668f1b47a2bcc5c65deb24e3fb44822ca41ca 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -1718,7 +1718,11 @@ void HTMLMediaElement::seek(double time, ExceptionState& exceptionState)
// 3 - Set the seeking IDL attribute to true.
// The flag will be cleared when the engine tells us the time has actually changed.
- m_seeking = true;
+ bool seekPending = false;
acolwell GONE FROM CHROMIUM 2014/04/16 15:33:13 nit: Just assign m_seeking to seekPending here and
+ if (m_seeking)
+ seekPending = true;
+ else
+ m_seeking = true;
// 5 - If the new playback position is later than the end of the media resource, then let it be the end
// of the media resource instead.
@@ -1758,6 +1762,10 @@ void HTMLMediaElement::seek(double time, ExceptionState& exceptionState)
if (noSeekRequired) {
if (time == now) {
scheduleEvent(EventTypeNames::seeking);
+ // An old seek event is still in progress for the same time value, so return from here
+ // and let media engine process it and update the status
+ if (seekPending)
+ return;
// FIXME: There must be a stable state before timeupdate+seeked are dispatched and seeking
// is reset to false. See http://crbug.com/266631
scheduleTimeupdateEvent(false);

Powered by Google App Engine
This is Rietveld 408576698