Bug 1365520. P2 - remove mMetadataTags for we can pass |aMetadata->mTags| without storing it. r?kaku
MozReview-Commit-ID: BcPwBTmXMZS
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -2133,17 +2133,16 @@ MediaDecoderStateMachine::
DecodeMetadataState::OnMetadataRead(MetadataHolder* aMetadata)
{
mMetadataRequest.Complete();
// Set mode to PLAYBACK after reading metadata.
Resource()->SetReadMode(MediaCacheStream::MODE_PLAYBACK);
mMaster->mInfo.emplace(aMetadata->mInfo);
- mMaster->mMetadataTags = aMetadata->mTags.forget();
mMaster->mMediaSeekable = Info().mMediaSeekable;
mMaster->mMediaSeekableOnlyInBufferedRanges =
Info().mMediaSeekableOnlyInBufferedRanges;
if (Info().mMetadataDuration.isSome()) {
mMaster->RecomputeDuration();
} else if (Info().mUnadjustedMetadataEndTime.isSome()) {
const TimeUnit unadjusted = Info().mUnadjustedMetadataEndTime.ref();
@@ -2163,17 +2162,17 @@ DecodeMetadataState::OnMetadataRead(Meta
Reader()->VideoIsHardwareAccelerated(),
mMaster->GetAmpleVideoFrames());
}
MOZ_ASSERT(mMaster->mDuration.Ref().isSome());
mMaster->mMetadataLoadedEvent.Notify(
nsAutoPtr<MediaInfo>(new MediaInfo(aMetadata->mInfo)),
- Move(mMaster->mMetadataTags),
+ Move(aMetadata->mTags),
MediaDecoderEventVisibility::Observable);
if (Info().IsEncrypted() && !mMaster->mCDMProxy) {
// Metadata parsing was successful but we're still waiting for CDM caps
// to become available so that we can build the correct decryptor/decoder.
SetState<WaitForCDMState>();
} else {
SetState<DecodingFirstFrameState>();
--- a/dom/media/MediaDecoderStateMachine.h
+++ b/dom/media/MediaDecoderStateMachine.h
@@ -626,18 +626,16 @@ private:
// prerolling is appropriate then. This flag is used to reduce the overhead
// of prerolling samples for media elements that may not play, both
// memory and CPU overhead.
bool mMinimizePreroll;
// Stores presentation info required for playback.
Maybe<MediaInfo> mInfo;
- nsAutoPtr<MetadataTags> mMetadataTags;
-
mozilla::MediaMetadataManager mMetadataManager;
// True if we've decoded first frames (thus having the start time) and
// notified the FirstFrameLoaded event. Note we can't initiate seek until the
// start time is known which happens when the first frames are decoded or we
// are playing an MSE stream (the start time is always assumed 0).
bool mSentFirstFrameLoadedEvent;