Chromium Code Reviews| Index: Source/core/html/HTMLMediaElement.cpp |
| diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp |
| index 91f87f6d7aef089312dd1dd65cbea2124e420c4d..900164c3b2b4789a598058c3731ffd91ce2e8cf1 100644 |
| --- a/Source/core/html/HTMLMediaElement.cpp |
| +++ b/Source/core/html/HTMLMediaElement.cpp |
| @@ -1841,7 +1841,8 @@ void HTMLMediaElement::seek(double time, ExceptionState& exceptionState) |
| scheduleEvent(EventTypeNames::seeking); |
| // 9 - Set the current playback position to the given new playback position |
| - m_player->seek(time); |
| + if (webMediaPlayer()) |
|
acolwell GONE FROM CHROMIUM
2014/06/02 22:34:17
You should not need this check. You shouldn't be a
Srirama
2014/06/03 07:06:02
Done.
|
| + webMediaPlayer()->seek(time); |
| // 10-14 are handled, if necessary, when the engine signals a readystate change or otherwise |
| // satisfies seek completion and signals a time change. |
| @@ -1881,7 +1882,7 @@ bool HTMLMediaElement::seeking() const |
| void HTMLMediaElement::refreshCachedTime() const |
| { |
| - m_cachedTime = m_player->currentTime(); |
| + m_cachedTime = webMediaPlayer() ? webMediaPlayer()->currentTime() : 0.0; |
|
acolwell GONE FROM CHROMIUM
2014/06/02 22:34:17
You shouldn't need this check. This method shouldn
Srirama
2014/06/03 07:06:02
It is null for preload:none case, when it is calle
|
| m_cachedTimeWallClockUpdateTime = WTF::currentTime(); |
| } |
| @@ -1915,7 +1916,8 @@ double HTMLMediaElement::currentTime() const |
| if (m_cachedTime != MediaPlayer::invalidTime() && m_paused) { |
| #if LOG_CACHED_TIME_WARNINGS |
| - double delta = m_cachedTime - m_player->currentTime(); |
| + double playerCurrentTime = webMediaPlayer() ? webMediaPlayer()->currentTime() : 0.0; |
|
acolwell GONE FROM CHROMIUM
2014/06/02 22:34:17
This check should be moved to the top with the !m_
Srirama
2014/06/03 07:06:02
Done.
|
| + double delta = m_cachedTime - playerCurrentTime; |
| if (delta > minCachedDeltaForWarning) |
| WTF_LOG(Media, "HTMLMediaElement::currentTime - WARNING, cached time is %f seconds off of media time when paused", delta); |
| #endif |
| @@ -1954,7 +1956,7 @@ double HTMLMediaElement::duration() const |
| if (m_mediaSource) |
| return m_mediaSource->duration(); |
| - return m_player->duration(); |
| + return webMediaPlayer() ? webMediaPlayer()->duration() : 0.0; |
|
acolwell GONE FROM CHROMIUM
2014/06/02 22:34:17
This check should not be needed. webMediaPlayer()
Srirama
2014/06/03 07:06:02
Done.
|
| } |
| bool HTMLMediaElement::paused() const |
| @@ -2770,7 +2772,8 @@ void HTMLMediaElement::mediaPlayerTimeChanged() |
| invalidateCachedTime(); |
| // 4.8.10.9 steps 12-14. Needed if no ReadyState change is associated with the seek. |
| - if (m_seeking && m_readyState >= HAVE_CURRENT_DATA && !m_player->seeking()) |
| + if (m_seeking && m_readyState >= HAVE_CURRENT_DATA |
| + && !(webMediaPlayer() && webMediaPlayer()->seeking())) |
|
acolwell GONE FROM CHROMIUM
2014/06/02 22:34:17
the pointer check should not be necessary since we
Srirama
2014/06/03 07:06:02
Done.
|
| finishSeek(); |
| // Always call scheduleTimeupdateEvent when the media engine reports a time discontinuity, |