[Webkit-unassigned] [Bug 113965] Add interfaces and stubs for audio and video tracks
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Apr 18 13:44:00 PDT 2013
https://bugs.webkit.org/show_bug.cgi?id=113965
--- Comment #94 from Brendan Long <b.long at cablelabs.com> 2013-04-18 13:42:16 PST ---
(In reply to comment #90)
> > Source/WebCore/html/HTMLMediaElement.cpp:2888
> > + // This cast is safe because we created the AudioTrack with the AudioTrackPrivate
> > + // passed to mediaPlayerDidAddAudioTrack.
> > + RefPtr<AudioTrack> track = static_cast<AudioTrack*>(prpTrack->client());
> > + if (!track)
> > + return;
>
> I still don't like this. There should be a better way to get from an AudioTrackPrivate to an AudioTrack. Perhaps the notification needs to come through the AudioTrackPrivate, like so:
>
> void AudioTrackPrivate::willBeRemoved()
> {
> client()->willRemoveAudioTrackPrivate(this);
> }
>
> void AudioTrack::willRemoveAudioTrackPrivate(AudioTrackPrivate* trackPrivate)
> {
> ASSERT(trackPrivate == m_private);
> mediaElement()->removeAudioTrack(this);
> }
Is there any reason that the AudioTrackPrivate shouldn't know its parent AudioTrack? I could add AudioTrack* m_track (basically identical to m_client), then:
removeAudioTrack(privateTrack->audioTrack());
The only weird thing I can think of for this is that m_client and m_track would be the same object, so it's kind of weird.
--
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