Index: Source/core/html/track/AutomaticTrackSelection.cpp |
diff --git a/Source/core/html/track/AutomaticTrackSelection.cpp b/Source/core/html/track/AutomaticTrackSelection.cpp |
index 1a9dd43693ca1b66d1df0d085438896f3aaf24e2..97a886299c5266274fc6c8acd74a76b126e752ed 100644 |
--- a/Source/core/html/track/AutomaticTrackSelection.cpp |
+++ b/Source/core/html/track/AutomaticTrackSelection.cpp |
@@ -123,8 +123,12 @@ void AutomaticTrackSelection::performAutomaticTextTrackSelection(const TrackGrou |
if (!trackToEnable && defaultTrack) |
trackToEnable = defaultTrack; |
- if (!trackToEnable && m_configuration.forceEnableSubtitleOrCaptionTrack && group.kind == TrackGroup::CaptionsAndSubtitles) |
- trackToEnable = fallbackTrack ? fallbackTrack : group.tracks[0]; |
+ if (!trackToEnable && m_configuration.forceEnableSubtitleOrCaptionTrack && group.kind == TrackGroup::CaptionsAndSubtitles) { |
+ if (fallbackTrack) |
+ trackToEnable = fallbackTrack; |
+ else |
+ trackToEnable = group.tracks[0]; |
+ } |
if (currentlyEnabledTracks.size()) { |
for (size_t i = 0; i < currentlyEnabledTracks.size(); ++i) { |