[Webkit-unassigned] [Bug 120369] New: Duplicate in-band tracks when switching <source> elements

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Aug 27 11:18:38 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=120369

           Summary: Duplicate in-band tracks when switching <source>
                    elements
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: Media Elements
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: b.long at cablelabs.com
                CC: eric.carlson at apple.com


When we change the source of a HTMLMediaElement like this:

    var newSource = document.createElement("source");
    newSource.src = "some-video.m4v";
    video.replaceChild(newSource, video.firstChild);

In HTMLMediaElement::loadNextSourceChild, we:

    // Recreate the media player for the new url
    createMediaPlayer();

And in HTMLMediaElement::createMediaPlayer():

    m_player = MediaPlayer::create(this);

This will cause any existing MediaPlayer to be destroyed, and because ~MediaPlayer removes the client:

    MediaPlayer::~MediaPlayer()
    {
        m_mediaPlayerClient = 0;
    }

It's impossible for the MediaPlayerPrivate to remove any existing in-band tracks.

One fix is to do this in createMediaPlayer():

    #if ENABLE(VIDEO_TRACK)
        removeAllInbandTracks();
    #endif
        m_player = MediaPlayer::create(this);

For some reason, media-related tests always time out for me, so I'm not able to attach the expected results for this test :\

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list