Skip to content
  • eric.carlson@apple.com's avatar
    Add in-band text track cues only once · 41d49216
    eric.carlson@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=104593
    
    Reviewed by Dean Jackson.
    
    Source/WebCore:
    
    Test: media/track/track-in-band-cues-added-once.html
    
    * html/track/InbandTextTrack.cpp:
    (WebCore::InbandTextTrack::hasCue): New.
    * html/track/InbandTextTrack.h:
    
    * html/track/TextTrackCue.cpp:
    (WebCore::TextTrackCue::setCueSettings): Remember the raw cue settings so they can be accessed later.
    * html/track/TextTrackCue.h:
    
    * platform/graphics/InbandTextTrackPrivateClient.h: Declare hasCue.
    
    * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
    (WebCore::InbandTextTrackPrivateAVF::processCue): Early return if m_player has been cleared.
    (WebCore::InbandTextTrackPrivateAVF::setMode): Ditto.
    
    * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
    (WebCore::MediaPlayerPrivateAVFoundation::seek): Clear the partially accumulated cue when the seek
        starts, not when it completes.
    (WebCore::MediaPlayerPrivateAVFoundation::seekCompleted): Ditto.
    (WebCore::MediaPlayerPrivateAVFoundation::flushCurrentCue): Don't add a cue if it is already in the
        text track cue list.
    * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
    (WebCore::MediaPlayerPrivateAVFoundationObjC::clearTextTracks): Drive-by cleanup, clear the track list completely.
    
    LayoutTests:
    
    Test to ensure that in-band text track cues are not added to the the cue list more than once.
    
    * media/track/track-in-band-cues-added-once-expected.txt: Added.
    * media/track/track-in-band-cues-added-once.html: Added.
    * platform/chromium/TestExpectations:
    * platform/efl/TestExpectations:
    * platform/gtk/TestExpectations:
    * platform/mac/TestExpectations:
    * platform/qt/TestExpectations:
    * platform/win/TestExpectations:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@138017 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    41d49216