| Index: Source/core/html/HTMLMediaElement.cpp
|
| diff --git a/Source/core/html/HTMLMediaElement.cpp b/Source/core/html/HTMLMediaElement.cpp
|
| index 77280ba10cc2e32dc70eaf19f2d09e8f2e14ae7b..436d57c0f4af581f7ee64bc84de1336b73e040a9 100644
|
| --- a/Source/core/html/HTMLMediaElement.cpp
|
| +++ b/Source/core/html/HTMLMediaElement.cpp
|
| @@ -2400,27 +2400,15 @@ static int textTrackLanguageSelectionScore(const TextTrack& track)
|
| if (languageMatchIndex >= languages.size())
|
| return 0;
|
|
|
| - // Matching a track language is more important than matching track type, so this multiplier must be
|
| - // greater than the maximum value returned by textTrackSelectionScore.
|
| - return (languages.size() - languageMatchIndex) * 10;
|
| + return languages.size() - languageMatchIndex;
|
| }
|
|
|
| -static int textTrackSelectionScore(const TextTrack& track, Settings* settings)
|
| +static int textTrackSelectionScore(const TextTrack& track)
|
| {
|
| - int trackScore = 0;
|
| -
|
| - if (!settings)
|
| - return trackScore;
|
| -
|
| if (track.kind() != TextTrack::captionsKeyword() && track.kind() != TextTrack::subtitlesKeyword())
|
| - return trackScore;
|
| -
|
| - if (track.kind() == TextTrack::subtitlesKeyword() && settings->shouldDisplaySubtitles())
|
| - trackScore = 1;
|
| - else if (track.kind() == TextTrack::captionsKeyword() && settings->shouldDisplayCaptions())
|
| - trackScore = 1;
|
| + return 0;
|
|
|
| - return trackScore + textTrackLanguageSelectionScore(track);
|
| + return textTrackLanguageSelectionScore(track);
|
| }
|
|
|
| void HTMLMediaElement::configureTextTrackGroup(const TrackGroup& group)
|
| @@ -2429,8 +2417,6 @@ void HTMLMediaElement::configureTextTrackGroup(const TrackGroup& group)
|
|
|
| WTF_LOG(Media, "HTMLMediaElement::configureTextTrackGroup(%d)", group.kind);
|
|
|
| - Settings* settings = document().settings();
|
| -
|
| // First, find the track in the group that should be enabled (if any).
|
| WillBeHeapVector<RefPtrWillBeMember<TextTrack> > currentlyEnabledTracks;
|
| RefPtrWillBeRawPtr<TextTrack> trackToEnable = nullptr;
|
| @@ -2443,7 +2429,7 @@ void HTMLMediaElement::configureTextTrackGroup(const TrackGroup& group)
|
| if (m_processingPreferenceChange && textTrack->mode() == TextTrack::showingKeyword())
|
| currentlyEnabledTracks.append(textTrack);
|
|
|
| - int trackScore = textTrackSelectionScore(*textTrack, settings);
|
| + int trackScore = textTrackSelectionScore(*textTrack);
|
| if (trackScore) {
|
| // * If the text track kind is { [subtitles or captions] [descriptions] } and the user has indicated an interest in having a
|
| // track with this text track kind, text track language, and text track label enabled, and there is no
|
|
|