Bug 1269408: P5. Only drop the seek target if it's exactly the seek target. r?gerald
If the Skip To Next Keyframe logic was activated, the next frame demuxed would have been passed the internal seek target, causing it to be unnecessarily dropped.
MozReview-Commit-ID: DExwMPLXlZu
--- a/dom/media/MediaFormatReader.cpp
+++ b/dom/media/MediaFormatReader.cpp
@@ -1111,17 +1111,17 @@ MediaFormatReader::Update(TrackType aTra
while (decoder.mTimeThreshold && decoder.mOutput.Length()) {
RefPtr<MediaData>& output = decoder.mOutput[0];
InternalSeekTarget target = decoder.mTimeThreshold.ref();
media::TimeUnit time = media::TimeUnit::FromMicroseconds(output->mTime);
if (time >= target.mTime) {
// We have reached our internal seek target.
decoder.mTimeThreshold.reset();
}
- if (time < target.mTime || target.mDropTarget) {
+ if (time < target.mTime || (target.mDropTarget && time == target.mTime)) {
LOGV("Internal Seeking: Dropping %s frame time:%f wanted:%f (kf:%d)",
TrackTypeToStr(aTrack),
media::TimeUnit::FromMicroseconds(output->mTime).ToSeconds(),
target.mTime.ToSeconds(),
output->mKeyframe);
decoder.mOutput.RemoveElementAt(0);
}
}