Changeset 154527 in webkit


Ignore:
Timestamp:
Aug 23, 2013 3:44:15 PM (11 years ago)
Author:
eric.carlson@apple.com
Message:

[Mac] some track language tags are not recognized
https://bugs.webkit.org/show_bug.cgi?id=119643

Source/WebCore:

Reviewed by Jere Noble.

No new tests, existing tests updated.

  • html/HTMLMediaElement.cpp:

(WebCore::HTMLMediaElement::HTMLMediaElement): Initialize m_captionDisplayMode from settings

if possible.

(WebCore::HTMLMediaElement::configureTextTrackGroup): Don't enable a default track when preferences

say captions should be disabled. Don't disable an already visible track if we don't find
a match unless preferences say captions should be disabled. m_forcedOrAutomaticSubtitleTrackLanguage ->
m_subtitleTrackLanguage.

(WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): If the language of the primary

audio track changes, only kick off a text track recalc if caption preference are set to "automatic".

  • html/HTMLMediaElement.h:
  • platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:

(WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation): Initialize m_characteristicsChanged

and m_delayCharacteristicsChangedNotification.

(WebCore::MediaPlayerPrivateAVFoundation::setHasVideo): Call characteristicsChanged.
(WebCore::MediaPlayerPrivateAVFoundation::setHasAudio): Ditto.
(WebCore::MediaPlayerPrivateAVFoundation::setHasClosedCaptions): Ditto.
(WebCore::MediaPlayerPrivateAVFoundation::characteristicsChanged): New, allows us to coalesce

calls to the media player when we know several characteristics may change.

(WebCore::MediaPlayerPrivateAVFoundation::setDelayCharacteristicsChangedNotification): Enable or

disable notification delay.

  • platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
  • platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:

(WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged): Always call languageOfPrimaryAudioTrack(),

a track may have changed so we may have a new language.

(WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack): Call [AVAssetTrack languageCode]

if [AVAssetTrack extendedLanguageTag] returns NULL in case the media file has an old
QuickTime language code.

LayoutTests:

Reviewed by Jer Noble.

Explicitly set caption mode to "Automatic" so the track 'default' attribute works.

  • media/track/text-track-cue-is-reachable.html:
  • media/track/text-track-is-reachable.html:
  • media/track/track-active-cues.html:
  • media/track/track-cue-overlap-snap-to-lines-not-set.html:
  • media/track/track-cue-rendering-horizontal.html:
  • media/track/track-cue-rendering-vertical.html:
  • media/track/track-kind.html:
  • media/track/track-large-timestamp.html:
  • media/track/track-mode.html:
  • media/track/track-text-track-cue-list.html:
  • media/track/track-webvtt-tc000-empty.html:
  • media/track/track-webvtt-tc002-bom.html:
  • media/track/track-webvtt-tc010-no-timings.html:
  • media/track/track-webvtt-tc027-empty-cue.html:
  • media/track/track-webvtt-tc028-unsupported-markup.html:
  • media/track/track-word-breaking.html:
  • media/video-test.js:

(setCaptionDisplayMode):

Location:
trunk
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r154518 r154527  
     12013-08-23  Eric Carlson  <eric.carlson@apple.com>
     2
     3        [Mac] some track language tags are not recognized
     4        https://bugs.webkit.org/show_bug.cgi?id=119643
     5
     6        Reviewed by Jer Noble.
     7
     8        Explicitly set caption mode to "Automatic" so the track 'default' attribute works.
     9
     10        * media/track/text-track-cue-is-reachable.html:
     11        * media/track/text-track-is-reachable.html:
     12        * media/track/track-active-cues.html:
     13        * media/track/track-cue-overlap-snap-to-lines-not-set.html:
     14        * media/track/track-cue-rendering-horizontal.html:
     15        * media/track/track-cue-rendering-vertical.html:
     16        * media/track/track-kind.html:
     17        * media/track/track-large-timestamp.html:
     18        * media/track/track-mode.html:
     19        * media/track/track-text-track-cue-list.html:
     20        * media/track/track-webvtt-tc000-empty.html:
     21        * media/track/track-webvtt-tc002-bom.html:
     22        * media/track/track-webvtt-tc010-no-timings.html:
     23        * media/track/track-webvtt-tc027-empty-cue.html:
     24        * media/track/track-webvtt-tc028-unsupported-markup.html:
     25        * media/track/track-word-breaking.html:
     26        * media/video-test.js:
     27        (setCaptionDisplayMode):
     28
    1292013-08-23  Filip Pizlo  <fpizlo@apple.com>
    230
  • trunk/LayoutTests/media/track/text-track-cue-is-reachable.html

    r102471 r154527  
    3838            }
    3939
     40            setCaptionDisplayMode('Automatic');
     41
    4042        </script>
    4143    </head>
  • trunk/LayoutTests/media/track/text-track-is-reachable.html

    r102471 r154527  
    3939            }
    4040
     41            setCaptionDisplayMode('Automatic');
     42
    4143        </script>
    4244    </head>
  • trunk/LayoutTests/media/track/track-active-cues.html

    r125793 r154527  
    4040                video.src = findMediaFile("video", "../content/test");
    4141            }
     42
     43            setCaptionDisplayMode('Automatic');
    4244           
    4345        </script>
  • trunk/LayoutTests/media/track/track-cue-overlap-snap-to-lines-not-set.html

    r150452 r154527  
    6666        }
    6767
     68        setCaptionDisplayMode('Automatic');
    6869        </script>
    6970    </head>
  • trunk/LayoutTests/media/track/track-cue-rendering-horizontal.html

    r150260 r154527  
    2727
    2828        <script src=../video-test.js></script>
     29        <script>
     30            setCaptionDisplayMode('Automatic');
     31        </script>
    2932    </head>
    3033    <body onload="loaded()">
  • trunk/LayoutTests/media/track/track-cue-rendering-vertical.html

    r150260 r154527  
    2828
    2929        <script src=../video-test.js></script>
     30        <script>
     31            setCaptionDisplayMode('Automatic');
     32        </script>
    3033    </head>
    3134    <body onload="loaded()">
  • trunk/LayoutTests/media/track/track-kind.html

    r117811 r154527  
    7777            }
    7878
     79            setCaptionDisplayMode('Automatic');
     80
    7981        </script>
    8082    </head>
  • trunk/LayoutTests/media/track/track-large-timestamp.html

    r113583 r154527  
    2121            }
    2222
     23            setCaptionDisplayMode('Automatic');
    2324        </script>
    2425    </head>
  • trunk/LayoutTests/media/track/track-mode.html

    r149197 r154527  
    4646                setMode("disabled");
    4747
     48                setCaptionDisplayMode('ForcedOnly');
     49
    4850                waitForEvent('cuechange', cuechange);
    4951                video.addEventListener('playing', playing);
     
    8789            }
    8890
     91            setCaptionDisplayMode('Automatic');
    8992        </script>
    9093    </head>
  • trunk/LayoutTests/media/track/track-text-track-cue-list.html

    r102212 r154527  
    3232            }
    3333
     34            setCaptionDisplayMode('Automatic');
    3435        </script>
    3536    </head>
  • trunk/LayoutTests/media/track/track-webvtt-tc000-empty.html

    r102212 r154527  
    1616            }
    1717
     18            setCaptionDisplayMode('Automatic');
    1819        </script>
    1920    </head>
  • trunk/LayoutTests/media/track/track-webvtt-tc002-bom.html

    r104624 r154527  
    3838                endTest();
    3939            }
     40
     41            setCaptionDisplayMode('Automatic');
    4042        </script>
    4143    </head>
  • trunk/LayoutTests/media/track/track-webvtt-tc010-no-timings.html

    r102212 r154527  
    2222            }
    2323
     24            setCaptionDisplayMode('Automatic');
    2425        </script>
    2526    </head>
  • trunk/LayoutTests/media/track/track-webvtt-tc027-empty-cue.html

    r102212 r154527  
    1616            }
    1717
     18            setCaptionDisplayMode('Automatic');
    1819        </script>
    1920    </head>
  • trunk/LayoutTests/media/track/track-webvtt-tc028-unsupported-markup.html

    r104624 r154527  
    3535            }
    3636
     37            setCaptionDisplayMode('Automatic');
    3738        </script>
    3839    </head>
  • trunk/LayoutTests/media/track/track-word-breaking.html

    r138282 r154527  
    3232        }
    3333
     34        setCaptionDisplayMode('Automatic');
    3435        </script>
    3536    </head>
  • trunk/LayoutTests/media/video-test.js

    r153568 r154527  
    358358    }
    359359}
     360
     361function setCaptionDisplayMode(mode)
     362{
     363    if (window.internals)
     364        internals.setCaptionDisplayMode(mode);
     365    else
     366        consoleWrite("<br><b>** This test only works in DRT! **<" + "/b><br>");
     367
     368}
  • trunk/Source/WebCore/ChangeLog

    r154526 r154527  
    1 2013-08-23  Brent Fulgham  <bfulgham@apple.com>
    2 
    3         [Windows] Unreviewed build correction. Need to force environment variable
    4         to be escaped when running nmake command.
    5 
    6         * WebCore.vcxproj/WebCoreGenerated.make:
    7 
    8 2013-08-23  Antti Koivisto  <antti@apple.com>
    9 
    10         Use ElementTraversal some more
    11         https://bugs.webkit.org/show_bug.cgi?id=120226
    12 
    13         Reviewed by Darin Adler.
    14 
    15         More traversal with tighter typing.
    16 
    17         * accessibility/AccessibilityNodeObject.cpp:
    18         (WebCore::AccessibilityNodeObject::canvasHasFallbackContent):
    19         (WebCore::siblingWithAriaRole):
    20         * accessibility/AccessibilityTable.cpp:
    21         (WebCore::AccessibilityTable::isDataTable):
    22         * css/CSSFontFaceSource.cpp:
    23         (WebCore::CSSFontFaceSource::getFontData):
    24         * dom/ContainerNode.cpp:
    25         (WebCore::willRemoveChild):
    26         * dom/ContainerNodeAlgorithms.h:
    27         (WebCore::ChildFrameDisconnector::ChildFrameDisconnector):
    28         (WebCore::ChildFrameDisconnector::collectFrameOwners):
    29         (WebCore::ChildFrameDisconnector::disconnect):
     12013-08-23  Eric Carlson  <eric.carlson@apple.com>
     2
     3        [Mac] some track language tags are not recognized
     4        https://bugs.webkit.org/show_bug.cgi?id=119643
     5
     6        Reviewed by Jere Noble.
     7
     8        No new tests, existing tests updated.
     9
    3010        * html/HTMLMediaElement.cpp:
    31         (WebCore::HTMLMediaElement::selectMediaResource):
    32         (WebCore::HTMLMediaElement::textTrackModeChanged):
    33         (WebCore::HTMLMediaElement::cancelPendingEventsAndCallbacks):
    34         * html/HTMLObjectElement.cpp:
    35         (WebCore::HTMLObjectElement::parametersForPlugin):
    36         (WebCore::HTMLObjectElement::containsJavaApplet):
    37         * html/HTMLParamElement.h:
    38         (WebCore::isHTMLParamElement):
    39         (WebCore::HTMLParamElement):
    40         * html/HTMLSourceElement.h:
    41         (WebCore::isHTMLSourceElement):
    42         (WebCore::HTMLSourceElement):
    43         * svg/SVGFontFaceElement.h:
    44         (WebCore::isSVGFontFaceElement):
    45         (WebCore::SVGFontFaceElement):
    46         (WebCore::toSVGFontFaceElement):
    47 
    48 2013-08-23  Andreas Kling  <akling@apple.com>
    49 
    50         Let Document keep its RenderView during render tree attach.
    51         <https://webkit.org/b/120224>
    52 
    53         Reviewed by Antti Koivisto.
    54 
    55         Remove prehistoric code that cleared Document's renderer pointer during tree attach.
    56 
    57         * dom/Document.cpp:
    58         (WebCore::Document::attach):
    59 
    60 2013-08-23  Darin Adler  <darin@apple.com>
    61 
    62         Reduce use of Node in HTMLTableRowsCollection, and use modern traversal idiom
    63         https://bugs.webkit.org/show_bug.cgi?id=120222
    64 
    65         Reviewed by Antti Koivisto.
    66 
    67         * html/HTMLTableRowElement.h:
    68         (WebCore::isHTMLTableRowElement): Added.
    69         (WebCore::isElementOfType<HTMLTableRowElement>): Added.
    70         (WebCore::toHTMLTableRowElement): Added.
    71 
    72         * html/HTMLTableRowsCollection.cpp:
    73         (WebCore::assertRowIsInTable): Refactored a bit. Changed #if as Andy Estes
    74         requested during rewview and got rid of local variables.
    75         (WebCore::HTMLTableRowsCollection::rowAfter): Moved a ocmment in here.
    76         Changed code to traverse elements instead of nodes, and used the Traversal<>
    77         template to eliminate some loops entirely.
    78         (WebCore::HTMLTableRowsCollection::lastRow): Ditto.
    79         (WebCore::HTMLTableRowsCollection::HTMLTableRowsCollection): Changed argument
    80         type from Node to HTMLTableElement.
    81         (WebCore::HTMLTableRowsCollection::create): Added an assertion for the value
    82         of the collection type argument, and added the typecast here needed for the
    83         change above.
    84         (WebCore::HTMLTableRowsCollection::virtualItemAfter): Removed the assertion
    85         here that was a subset of the assertion we now have inside the rowAfter function.
    86 
    87         * html/HTMLTableRowsCollection.h: Added FINAL. Made single-argument constructor
    88         explicit.
    89 
    90 2013-08-23  Alex Christensen  <achristensen@apple.com>
    91 
    92         Re-separating Win32 and Win64 builds.
    93         https://bugs.webkit.org/show_bug.cgi?id=120178
    94 
    95         Reviewed by Brent Fulgham.
    96 
    97         * WebCore.vcxproj/WebCoreGenerated.make:
    98         * WebCore.vcxproj/WebCoreGeneratedWinCairo.make:
    99         Pass PlatformArchitecture as a command line parameter to bash scripts
    100         and use PlatformArchitecture to determine which directory to delete
    101         while cleaning (obj32 or obj64).
    102         * WebCore.vcxproj/WebCoreGeneratedWinCairoCommon.props:
    103         Export PlatformArchitecture to be used by make and cmd scripts.
    104         * WebCore.vcxproj/build-generated-files.sh:
    105         Use PlatformArchitecture from command line to determine which object directory to use (obj32 or obj64).
    106         * WebCore.vcxproj/copyForwardingHeaders.cmd:
    107         * WebCore.vcxproj/copyWebCoreResourceFiles.cmd:
    108         Use PlatformArchitecture to determine which directory to copy to (obj32 or obj64).
    109 
     11        (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize m_captionDisplayMode from settings
     12            if possible.
     13        (WebCore::HTMLMediaElement::configureTextTrackGroup): Don't enable a default track when preferences
     14            say captions should be disabled. Don't disable an already visible track if we don't find
     15            a match unless preferences say captions should be disabled. m_forcedOrAutomaticSubtitleTrackLanguage ->
     16            m_subtitleTrackLanguage.
     17        (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): If the language of the primary
     18            audio track changes, only kick off a text track recalc if caption preference are set to "automatic".
     19        * html/HTMLMediaElement.h:
     20
     21        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
     22        (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation): Initialize m_characteristicsChanged
     23            and m_delayCharacteristicsChangedNotification.
     24        (WebCore::MediaPlayerPrivateAVFoundation::setHasVideo): Call characteristicsChanged.
     25        (WebCore::MediaPlayerPrivateAVFoundation::setHasAudio): Ditto.
     26        (WebCore::MediaPlayerPrivateAVFoundation::setHasClosedCaptions): Ditto.
     27        (WebCore::MediaPlayerPrivateAVFoundation::characteristicsChanged): New, allows us to coalesce
     28            calls to the media player when we know several characteristics may change.
     29        (WebCore::MediaPlayerPrivateAVFoundation::setDelayCharacteristicsChangedNotification): Enable or
     30            disable notification delay.
     31        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
     32
     33        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
     34        (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged): Always call languageOfPrimaryAudioTrack(),
     35            a track may have changed so we may have a new language.
     36        (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack): Call [AVAssetTrack languageCode]
     37            if [AVAssetTrack extendedLanguageTag] returns NULL in case the media file has an old
     38            QuickTime language code.
    11039
    111402013-08-23  Andreas Kling  <akling@apple.com>
  • trunk/Source/WebCore/html/HTMLMediaElement.cpp

    r154525 r154527  
    341341#if ENABLE(VIDEO_TRACK)
    342342    document->registerForCaptionPreferencesChangedCallbacks(this);
     343    if (document->page())
     344        m_captionDisplayMode = document->page()->group().captionPreferences()->captionDisplayMode();
    343345#endif
    344346}
     
    32143216    Page* page = document()->page();
    32153217    CaptionUserPreferences* captionPreferences = page? page->group().captionPreferences() : 0;
     3218    CaptionUserPreferences::CaptionDisplayMode displayMode = captionPreferences ? captionPreferences->captionDisplayMode() : CaptionUserPreferences::Automatic;
    32163219
    32173220    // First, find the track in the group that should be enabled (if any).
     
    32603263            // element's list of text tracks whose text track mode is showing or showing by default
    32613264            //    Let the text track mode be showing by default.
    3262             defaultTrack = textTrack;
     3265            if (group.kind != TrackGroup::CaptionsAndSubtitles || displayMode != CaptionUserPreferences::ForcedOnly)
     3266                defaultTrack = textTrack;
    32633267        }
    32643268    }
     
    32663270    if (!trackToEnable && defaultTrack)
    32673271        trackToEnable = defaultTrack;
    3268 
     3272   
    32693273    // If no track matches the user's preferred language, none was marked as 'default', and there is a forced subtitle track
    32703274    // in the same language as the language of the primary audio track, enable it.
     
    32723276        trackToEnable = forcedSubitleTrack;
    32733277
     3278    // If no track matches, don't disable an already visible track unless preferences say they all should be off.
     3279    if (group.kind != TrackGroup::CaptionsAndSubtitles || displayMode != CaptionUserPreferences::ForcedOnly) {
     3280        if (!trackToEnable && !defaultTrack && group.visibleTrack)
     3281            trackToEnable = group.visibleTrack;
     3282    }
     3283   
    32743284    // If no track matches the user's preferred language and non was marked 'default', enable the first track
    32753285    // because the user has explicitly stated a preference for this kind of track.
     
    32773287        trackToEnable = fallbackTrack;
    32783288
    3279     if (!defaultTrack && trackToEnable && trackToEnable != fallbackTrack && m_captionDisplayMode != CaptionUserPreferences::AlwaysOn)
    3280         m_forcedOrAutomaticSubtitleTrackLanguage = trackToEnable->language();
     3289    if (trackToEnable)
     3290        m_subtitleTrackLanguage = trackToEnable->language();
    32813291    else
    3282         m_forcedOrAutomaticSubtitleTrackLanguage = emptyString();
     3292        m_subtitleTrackLanguage = emptyString();
    32833293   
    32843294    if (currentlyEnabledTracks.size()) {
     
    38413851
    38423852#if ENABLE(VIDEO_TRACK)
    3843     if (m_forcedOrAutomaticSubtitleTrackLanguage != m_player->languageOfPrimaryAudioTrack())
     3853    if (m_captionDisplayMode == CaptionUserPreferences::Automatic && m_subtitleTrackLanguage != m_player->languageOfPrimaryAudioTrack())
    38443854        markCaptionAndSubtitleTracksAsUnconfigured(AfterDelay);
    38453855#endif
  • trunk/Source/WebCore/html/HTMLMediaElement.h

    r154371 r154527  
    725725    bool m_processingPreferenceChange : 1;
    726726
    727     String m_forcedOrAutomaticSubtitleTrackLanguage;
     727    String m_subtitleTrackLanguage;
    728728    float m_lastTextTrackUpdateTime;
    729729
  • trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp

    r152884 r154527  
    6464    , m_requestedRate(1)
    6565    , m_delayCallbacks(0)
     66    , m_delayCharacteristicsChangedNotification(0)
    6667    , m_mainThreadCallPending(false)
    6768    , m_assetIsPlayable(false)
     
    7677    , m_playWhenFramesAvailable(false)
    7778    , m_inbandTrackConfigurationPending(false)
     79    , m_characteristicsChanged(false)
    7880    , m_seekCount(0)
    7981{
     
    329331    if (m_cachedHasVideo != b) {
    330332        m_cachedHasVideo = b;
    331         m_player->characteristicChanged();
     333        characteristicsChanged();
    332334    }
    333335}
     
    337339    if (m_cachedHasAudio != b) {
    338340        m_cachedHasAudio = b;
    339         m_player->characteristicChanged();
     341        characteristicsChanged();
    340342    }
    341343}
     
    345347    if (m_cachedHasCaptions != b) {
    346348        m_cachedHasCaptions = b;
    347         m_player->characteristicChanged();
    348     }
     349        characteristicsChanged();
     350    }
     351}
     352
     353void MediaPlayerPrivateAVFoundation::characteristicsChanged()
     354{
     355    if (m_delayCharacteristicsChangedNotification) {
     356        m_characteristicsChanged = true;
     357        return;
     358    }
     359
     360    m_characteristicsChanged = false;
     361    m_player->characteristicChanged();
     362}
     363
     364void MediaPlayerPrivateAVFoundation::setDelayCharacteristicsChangedNotification(bool delay)
     365{
     366    if (delay) {
     367        m_delayCharacteristicsChangedNotification++;
     368        return;
     369    }
     370   
     371    ASSERT(m_delayCharacteristicsChangedNotification);
     372    m_delayCharacteristicsChangedNotification--;
     373    if (!m_delayCharacteristicsChangedNotification && m_characteristicsChanged)
     374        characteristicsChanged();
    349375}
    350376
  • trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h

    r152876 r154527  
    235235    void setHasAudio(bool);
    236236    void setHasClosedCaptions(bool);
     237    void characteristicsChanged();
     238    void setDelayCharacteristicsChangedNotification(bool);
    237239    void setDelayCallbacks(bool) const;
    238240    void setIgnoreLoadStateChanges(bool delay) { m_ignoreLoadStateChanges = delay; }
     
    293295    float m_requestedRate;
    294296    mutable int m_delayCallbacks;
     297    int m_delayCharacteristicsChangedNotification;
    295298    bool m_mainThreadCallPending;
    296299    bool m_assetIsPlayable;
     
    305308    bool m_playWhenFramesAvailable;
    306309    bool m_inbandTrackConfigurationPending;
     310    bool m_characteristicsChanged;
    307311    size_t m_seekCount;
    308312};
  • trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm

    r154127 r154527  
    989989        return;
    990990
     991    setDelayCharacteristicsChangedNotification(true);
     992
    991993    bool haveCCTrack = false;
    992994    bool hasCaptions = false;
     
    10481050    sizeChanged();
    10491051
    1050     if (!primaryAudioTrackLanguage.isNull() && primaryAudioTrackLanguage != languageOfPrimaryAudioTrack())
    1051         player()->characteristicChanged();
     1052    if (primaryAudioTrackLanguage != languageOfPrimaryAudioTrack())
     1053        characteristicsChanged();
     1054
     1055    setDelayCharacteristicsChangedNotification(false);
    10521056}
    10531057
     
    14991503    AVAssetTrack *track = [tracks objectAtIndex:0];
    15001504    NSString *language = [track extendedLanguageTag];
     1505
     1506    // If the language code is stored as a QuickTime 5-bit packed code there aren't enough bits for a full
     1507    // RFC 4646 language tag so extendedLanguageTag returns NULL. In this case languageCode will return the
     1508    // ISO 639-2/T language code so check it.
     1509    if (!language)
     1510        language = [track languageCode];
    15011511
    15021512    // Some legacy tracks have "und" as a language, treat that the same as no language at all.
Note: See TracChangeset for help on using the changeset viewer.