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

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

Issue 407523002: added prevent check for m_player in duration() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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 | no next file » | 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 f744a9802030441e0816d3724ef0c94db346aad0..a17fc12125df9e81f9e4ac6a36d6b12f6a1ef70c 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -2081,7 +2081,10 @@ void HTMLMediaElement::setCurrentTime(double time, ExceptionState& exceptionStat
double HTMLMediaElement::duration() const
{
- if (m_readyState < HAVE_METADATA)
+ // FIXME: remove m_player check once we figure out how m_player is going
+ // out of sync with readystate. m_player is cleared but readystate is not set
+ // to HAVE_NOTHING
+ if (!m_player || m_readyState < HAVE_METADATA)
return std::numeric_limits<double>::quiet_NaN();
// FIXME: Refactor so m_duration is kept current (in both MSE and
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698