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

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

Issue 1228293003: Return early in automaticTrackSelectionForUpdatedUserPreference() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 29a67a7b11065fab209b7ad7b989329a26b8ae6c..7f980b63dbf0229bebba1107adba9039a74c6844 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -3279,6 +3279,9 @@ void HTMLMediaElement::setTextTrackKindUserPreferenceForAllMediaElements(Documen
void HTMLMediaElement::automaticTrackSelectionForUpdatedUserPreference()
{
+ if (!m_textTracks || !m_textTracks->length())
+ return;
+
markCaptionAndSubtitleTracksAsUnconfigured();
m_processingPreferenceChange = true;
m_closedCaptionsVisible = false;
@@ -3287,8 +3290,7 @@ void HTMLMediaElement::automaticTrackSelectionForUpdatedUserPreference()
// If a track is set to 'showing' post performing automatic track selection,
// set closed captions state to visible to update the CC button and display the track.
- if (m_textTracks)
- m_closedCaptionsVisible = m_textTracks->hasShowingTracks();
+ m_closedCaptionsVisible = m_textTracks->hasShowingTracks();
updateTextTrackDisplay();
}
« 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