Bug 1272964: P6. Exclude frames dropped due to internal seeking from calculations. r=cpearce

MozReview-Commit-ID: HKnEaUh3rkV

--HG--
extra : rebase_source : adb5d9313ffa66b949991e96f9a48df835ae6451
This commit is contained in:
Jean-Yves Avenard 2016-05-19 17:03:39 +08:00
Родитель aafa084df3
Коммит 778a01fa9e
1 изменённых файлов: 10 добавлений и 9 удалений

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

@ -673,8 +673,6 @@ MediaFormatReader::NotifyNewOutput(TrackType aTrack, MediaData* aSample)
}
decoder.mOutput.AppendElement(aSample);
decoder.mNumSamplesOutput++;
decoder.mNumSamplesOutputTotal++;
decoder.mNumSamplesOutputTotalSinceTelemetry++;
ScheduleUpdate(aTrack);
}
@ -1145,12 +1143,22 @@ MediaFormatReader::Update(TrackType aTrack)
target.Time().ToSeconds(),
output->mKeyframe);
decoder.mOutput.RemoveElementAt(0);
decoder.mSizeOfQueue -= 1;
}
}
if (decoder.HasPromise()) {
needOutput = true;
if (decoder.mOutput.Length()) {
RefPtr<MediaData> output = decoder.mOutput[0];
decoder.mOutput.RemoveElementAt(0);
decoder.mSizeOfQueue -= 1;
decoder.mLastSampleTime =
Some(TimeInterval(TimeUnit::FromMicroseconds(output->mTime),
TimeUnit::FromMicroseconds(output->GetEndTime())));
decoder.mNumSamplesOutputTotal++;
decoder.mNumSamplesOutputTotalSinceTelemetry++;
ReturnOutput(output, aTrack);
// We have a decoded sample ready to be returned.
if (aTrack == TrackType::kVideoTrack) {
uint64_t delta =
@ -1161,13 +1169,6 @@ MediaFormatReader::Update(TrackType aTrack)
mVideo.mIsHardwareAccelerated =
mVideo.mDecoder && mVideo.mDecoder->IsHardwareAccelerated(error);
}
RefPtr<MediaData> output = decoder.mOutput[0];
decoder.mOutput.RemoveElementAt(0);
decoder.mSizeOfQueue -= 1;
decoder.mLastSampleTime =
Some(TimeInterval(TimeUnit::FromMicroseconds(output->mTime),
TimeUnit::FromMicroseconds(output->GetEndTime())));
ReturnOutput(output, aTrack);
} else if (decoder.mError) {
LOG("Rejecting %s promise: DECODE_ERROR", TrackTypeToStr(aTrack));
decoder.RejectPromise(DECODE_ERROR, __func__);