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

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

Issue 18856005: Fix HTMLMediaElement so that it doesn't add cues for disabled text tracks. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 7 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 | « LayoutTests/media/track/track-disabled-expected.txt ('k') | Source/core/html/track/TextTrackCue.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 ed65abe872e271a83a47b550a83a90038999fd7f..889798867248f286a0f763d6a1e0e10e02e8c056 100644
--- a/Source/core/html/HTMLMediaElement.cpp
+++ b/Source/core/html/HTMLMediaElement.cpp
@@ -1270,9 +1270,11 @@ void HTMLMediaElement::endIgnoringTrackDisplayUpdateRequests()
updateActiveTextTrackCues(currentTime());
}
-void HTMLMediaElement::textTrackAddCues(TextTrack*, const TextTrackCueList* cues)
+void HTMLMediaElement::textTrackAddCues(TextTrack* track, const TextTrackCueList* cues)
{
LOG(Media, "HTMLMediaElement::textTrackAddCues");
+ if (track->mode() == TextTrack::disabledKeyword())
+ return;
TrackDisplayUpdateScope scope(this);
for (size_t i = 0; i < cues->length(); ++i)
@@ -1288,8 +1290,11 @@ void HTMLMediaElement::textTrackRemoveCues(TextTrack*, const TextTrackCueList* c
textTrackRemoveCue(cues->item(i)->track(), cues->item(i));
}
-void HTMLMediaElement::textTrackAddCue(TextTrack*, PassRefPtr<TextTrackCue> cue)
+void HTMLMediaElement::textTrackAddCue(TextTrack* track, PassRefPtr<TextTrackCue> cue)
{
+ if (track->mode() == TextTrack::disabledKeyword())
+ return;
+
// Negative duration cues need be treated in the interval tree as
// zero-length cues.
double endTime = max(cue->startTime(), cue->endTime());
« no previous file with comments | « LayoutTests/media/track/track-disabled-expected.txt ('k') | Source/core/html/track/TextTrackCue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698