Bug 1348432 - move the mMediaTracksConstructed flag back to MediaDecoder; r=jwwang
This mMediaTracksConstructed flag should belong to a MediaDecoder, every time a HTMLMediaElement switches its MediaDecoder, the flag should be reset to false again. So, we move the mMediaTracksConstructed flag back to MediaDecoder, by this way, HTMLMediaElement provides only the mechanism to construct and remove media tracks, and MediaDecoder uses the flag, mMediaTracksConstructed, to provide policy. MozReview-Commit-ID: L7mMAmLjQCy
This commit is contained in:
@@ -3723,7 +3723,6 @@ HTMLMediaElement::HTMLMediaElement(already_AddRefed<mozilla::dom::NodeInfo>& aNo
|
||||
mDefaultPlaybackStartPosition(0.0),
|
||||
mIsAudioTrackAudible(false),
|
||||
mHasSuspendTaint(false),
|
||||
mMediaTracksConstructed(false),
|
||||
mVisibilityState(Visibility::UNTRACKED),
|
||||
mErrorSink(new ErrorSink(this)),
|
||||
mAudioChannelWrapper(new AudioChannelAgentCallback(this, mAudioChannel))
|
||||
@@ -7423,11 +7422,7 @@ HTMLMediaElement::GetDocument() const
|
||||
void
|
||||
HTMLMediaElement::ConstructMediaTracks(const MediaInfo* aInfo)
|
||||
{
|
||||
if (mMediaTracksConstructed || !aInfo) {
|
||||
return;
|
||||
}
|
||||
|
||||
mMediaTracksConstructed = true;
|
||||
MOZ_ASSERT(aInfo);
|
||||
|
||||
AudioTrackList* audioList = AudioTracks();
|
||||
if (audioList && aInfo->HasAudio()) {
|
||||
@@ -7461,8 +7456,6 @@ HTMLMediaElement::RemoveMediaTracks()
|
||||
if (videoList) {
|
||||
videoList->RemoveTracks();
|
||||
}
|
||||
|
||||
mMediaTracksConstructed = false;
|
||||
}
|
||||
|
||||
class MediaElementGMPCrashHelper : public GMPCrashHelper
|
||||
|
||||
Reference in New Issue
Block a user