https://bugs.webkit.org/show_bug.cgi?id=128976
Reviewed by Jer Noble.
No new tests, covered by existing tests.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::refreshCachedTime): Don't mark the cached time as valid
until it is non-zero.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@164296
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-02-18 Eric Carlson <eric.carlson@apple.com>
+
+ Do not cache media time until media engine returns a non-zero value
+ https://bugs.webkit.org/show_bug.cgi?id=128976
+
+ Reviewed by Jer Noble.
+
+ No new tests, covered by existing tests.
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::refreshCachedTime): Don't mark the cached time as valid
+ until it is non-zero.
+
2014-02-18 Mihai Tica <mitica@adobe.com>
[CSS Blending] Add -webkit-blend-mode support for SVG.
void HTMLMediaElement::refreshCachedTime() const
{
m_cachedTime = m_player->currentTime();
+ if (!m_cachedTime) {
+ // Do not use m_cachedTime until the media engine returns a non-zero value because we can't
+ // estimate current time until playback actually begins.
+ invalidateCachedTime();
+ return;
+ }
+
+ LOG(Media, "HTMLMediaElement::refreshCachedTime - caching time %f", m_cachedTime);
m_clockTimeAtLastCachedTimeUpdate = monotonicallyIncreasingTime();
}
-void HTMLMediaElement::invalidateCachedTime()
+void HTMLMediaElement::invalidateCachedTime() const
{
LOG(Media, "HTMLMediaElement::invalidateCachedTime");
virtual void mediaCanStart() override;
void setShouldDelayLoadEvent(bool);
- void invalidateCachedTime();
+ void invalidateCachedTime() const;
void refreshCachedTime() const;
bool hasMediaControls() const;