RESOLVED FIXED 115043
[Mac] forced subtitle track should change when audio track language changes
https://bugs.webkit.org/show_bug.cgi?id=115043
Summary [Mac] forced subtitle track should change when audio track language changes
Eric Carlson
Reported 2013-04-23 09:11:44 PDT
Because forced subtitles are always shown in the same language as the primary audio track, the forced track should change when the primary audio track changes to a different language.
Attachments
Proposed patch (9.40 KB, patch)
2013-04-23 09:28 PDT, Eric Carlson
no flags
Eric Carlson
Comment 1 2013-04-23 09:12:07 PDT
Eric Carlson
Comment 2 2013-04-23 09:28:53 PDT
Created attachment 199246 [details] Proposed patch
Jer Noble
Comment 3 2013-04-23 10:34:41 PDT
Comment on attachment 199246 [details] Proposed patch View in context: https://bugs.webkit.org/attachment.cgi?id=199246&action=review > Source/WebCore/ChangeLog:16 > + (WebCore::HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured): Take parameter toa allow Nit: toa -> to > Source/WebCore/html/HTMLMediaElement.cpp:3244 > + if (trackToEnable && m_captionDisplayMode != CaptionUserPreferences::AlwaysOn && !defaultTrack && trackToEnable != fallbackTrack) Can we move the "trackToEnable" checks together? They all seem equally cheap (i.e., pointer comparisons). Also, should this be an else-if? > Source/WebCore/html/HTMLMediaElement.h:557 > + enum ReconfigureMode { > + Immediately, > + AfterDelay, > + }; > + void markCaptionAndSubtitleTracksAsUnconfigured(ReconfigureMode); Ooh, good use of a boolean enum! > Source/WebCore/page/CaptionUserPreferencesMac.mm:630 > + if ((trackHasOnlyForcedSubtitles && displayMode != ForcedOnly) || (displayMode == ForcedOnly && !trackHasOnlyForcedSubtitles)) Why is the trackHasOnlyForcedSubtitles check order reversed? I mean, if you want to go all funhouse-mirror, it should be: if ((trackHasOnlyForcedSubtitles && displayMode != ForcedOnly) || (ForcedOnly == displayMode && !trackHasOnlyForcedSubtitles)) :-D Or, this could just be re-written as: if (trackHasOnlyForcedSubtitles == (displayMode != ForcedOnly)) But if that's "too clever by half", I'd just move things around to make the two halves more parallel: if ((trackHasOnlyForcedSubtitles && displayMode != ForcedOnly) || (!trackHasOnlyForcedSubtitles && displayMode == ForcedOnly))
Eric Carlson
Comment 4 2013-04-23 16:34:44 PDT
Note You need to log in before you can comment on or make changes to this bug.