Bug 1309516 part 8 - modify MDSM::RecomputeDuration();r=jwwang

MozReview-Commit-ID: 6pM7Kn3kZco

--HG--
extra : rebase_source : 20b5086d68d4976cb62728e02ca9af8cb8f3862e
This commit is contained in:
Kaku Kuo 2016-10-24 15:04:52 +08:00
parent 58eac194d2
commit 235ffd3551

View File

@ -2411,7 +2411,10 @@ void MediaDecoderStateMachine::RecomputeDuration()
duration = TimeUnit::FromSeconds(d);
} else if (mEstimatedDuration.Ref().isSome()) {
duration = mEstimatedDuration.Ref().ref();
} else if (Info().mMetadataDuration.isSome()) {
} else if (mInfo.isSome() && Info().mMetadataDuration.isSome()) {
// We need to check mInfo.isSome() because that this method might be invoked
// while mObservedDuration is changed which might before the metadata been
// read.
duration = Info().mMetadataDuration.ref();
} else {
return;