Change fast seek logic to prevent ping-ponging.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Aug 2017 19:03:57 +0000 (19:03 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Aug 2017 19:03:57 +0000 (19:03 +0000)
commitbe8f3950d19747138ff70f53ad45f2810f8bf362
tree42fab35f2b86a169e32c4a2fe75aba2cde4af086
parentddf9e67ef017f2987f6ab4902460b326d5cd2d67
Change fast seek logic to prevent ping-ponging.
https://bugs.webkit.org/show_bug.cgi?id=175167
rdar://problem/32936116

Patch by Jeremy Jones <jeremyj@apple.com> on 2017-08-08
Reviewed by Jer Noble.

Source/WebCore:

Updated test: media/video-fast-seek.html

Changed fast seek behavior to always seek early than seek time; and after current time when seeking forward.
This prevents ping-ponging, where a fast seek overshoots the target looking for a keyframe.
A subsequent seek will suddenly be on the other side of current time and
will search in the opposite direction for a key frame; repeat.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::fastSeek):

LayoutTests:

Test now requires forward fast seek result to be between current time and the target time,
and a backward seek to be before the seek time.

* media/video-fast-seek.html:
* media/media-source/media-source-fastseek.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220414 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/media/media-source/media-source-fastseek-expected.txt
LayoutTests/media/media-source/media-source-fastseek.html
LayoutTests/media/video-fast-seek-expected.txt
LayoutTests/media/video-fast-seek.html
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMediaElement.cpp