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

MozReview-Commit-ID: 6pM7Kn3kZco

--HG--
extra : rebase_source : 5a9afb75df8d81cef370b7f0997ef6d8fe3121c2
This commit is contained in:
Kaku Kuo 2016-10-24 15:04:52 +08:00
Родитель dd76514a9c
Коммит 04d17fcd76
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -2275,7 +2275,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;