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

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: Added new line in the expected output to match the test case 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
« no previous file with comments | « LayoutTests/media/video-double-seek-currentTime-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLMediaElement.cpp
diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp
index e3552279e73c85d31676bb58f87f3071accbc726..a1b315ee13a62c73184a708751cb011486d4e3e4 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -1717,6 +1717,7 @@ 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.
+ bool previousSeekStillPending = m_seeking;
m_seeking = true;
// 5 - If the new playback position is later than the end of the media resource, then let it be the end
@@ -1757,6 +1758,8 @@ void HTMLMediaElement::seek(double time, ExceptionState& exceptionState)
if (noSeekRequired) {
if (time == now) {
scheduleEvent(EventTypeNames::seeking);
+ if (previousSeekStillPending)
+ 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);
« no previous file with comments | « LayoutTests/media/video-double-seek-currentTime-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698