Commit 28f3cb5
[HTMLMediaElement] Reschedule timeupdate event if fired too early
https://bugs.webkit.org/show_bug.cgi?id=279055
Reviewed by Xabier Rodriguez-Calvar.
HTMLMediaElement fires 'timeupdate' every 250ms in repeating timer. If the
timer is fired before 250ms from the last occurrence, it is silently skipped
and needs to wait for another 250ms. As a result, the gap between two
following timeupdate events may vary 250-500ms.
This may happen in two cases:
1) Non-periodic timeupdate event is scheduled for any reason.
2) When the difference between two timer calls is lower than 250ms. This may
happen when there are multiple timers to handle at the same time in
ThreadTimers (maxDurationOfFiringTimers).
Original author: Andrzej Surdej <Andrzej_Surdej@comcast.com>
See: #1392
* Source/WebCore/html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::scheduleTimeupdateEvent): Schedule next event on the remaining time difference so that maxTimeupdateEventFrequency is honored, instead of waiting a full cycle.
Canonical link: https://commits.webkit.org/283264@main1 parent 0df71ef commit 28f3cb5
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4248 | 4248 | | |
4249 | 4249 | | |
4250 | 4250 | | |
4251 | | - | |
| 4251 | + | |
| 4252 | + | |
| 4253 | + | |
4252 | 4254 | | |
| 4255 | + | |
4253 | 4256 | | |
4254 | 4257 | | |
4255 | 4258 | | |
| |||
0 commit comments