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

Unified Diff: Source/core/html/HTMLMediaElement.cpp

Issue 850943002: Remove MediaPlayer::invalidTime() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 11 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 | « no previous file | Source/core/html/MediaController.cpp » ('j') | 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 2abdc36a09c964a95c2230743f09eb291c2339ff..344e390dcf668a7b374ba7ac1a92d6b8bba74363 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -350,8 +350,8 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document& docum
, m_webLayer(nullptr)
, m_preload(MediaPlayer::Auto)
, m_displayMode(Unknown)
- , m_cachedTime(MediaPlayer::invalidTime())
- , m_fragmentEndTime(MediaPlayer::invalidTime())
+ , m_cachedTime(std::numeric_limits<double>::quiet_NaN())
+ , m_fragmentEndTime(std::numeric_limits<double>::quiet_NaN())
, m_pendingActionFlags(0)
, m_userGestureRequiredForPlay(false)
, m_playing(false)
@@ -1852,7 +1852,7 @@ void HTMLMediaElement::setReadyState(ReadyState state)
m_defaultPlaybackStartPosition = 0;
double initialPlaybackPosition = fragmentParser.startTime();
- if (initialPlaybackPosition == MediaPlayer::invalidTime())
+ if (std::isnan(initialPlaybackPosition))
initialPlaybackPosition = 0;
if (!jumped && initialPlaybackPosition > 0) {
@@ -2103,7 +2103,7 @@ void HTMLMediaElement::refreshCachedTime() const
void HTMLMediaElement::invalidateCachedTime()
{
WTF_LOG(Media, "HTMLMediaElement::invalidateCachedTime(%p)", this);
- m_cachedTime = MediaPlayer::invalidTime();
+ m_cachedTime = std::numeric_limits<double>::quiet_NaN();
}
// playback state
@@ -2120,7 +2120,7 @@ double HTMLMediaElement::currentTime() const
return m_lastSeekTime;
}
- if (m_cachedTime != MediaPlayer::invalidTime() && m_paused) {
+ if (!std::isnan(m_cachedTime) && m_paused) {
#if LOG_CACHED_TIME_WARNINGS
static const double minCachedDeltaForWarning = 0.01;
double delta = m_cachedTime - webMediaPlayer()->currentTime();
@@ -2493,8 +2493,8 @@ void HTMLMediaElement::playbackProgressTimerFired(Timer<HTMLMediaElement>*)
{
ASSERT(m_player);
- if (m_fragmentEndTime != MediaPlayer::invalidTime() && currentTime() >= m_fragmentEndTime && directionOfPlayback() == Forward) {
- m_fragmentEndTime = MediaPlayer::invalidTime();
+ if (!std::isnan(m_fragmentEndTime) && currentTime() >= m_fragmentEndTime && directionOfPlayback() == Forward) {
+ m_fragmentEndTime = std::numeric_limits<double>::quiet_NaN();
if (!m_mediaController && !m_paused) {
UseCounter::count(document(), UseCounter::HTMLMediaElementPauseAtFragmentEnd);
// changes paused to true and fires a simple event named pause at the media element.
« no previous file with comments | « no previous file | Source/core/html/MediaController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698