Bug 1269408: P5. Only drop the seek target if it's exactly the seek target. r?gerald draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 05 May 2016 15:09:42 +1000
changeset 364202 4c7b1824bd51ca566a112d81b7509a011ba2bd46
parent 364201 6fa970aefeb4360ec493302c5e5ae0c446c44ba1
child 364203 e0590174f7587c9a1ffbbe4e7a065a5af2706271
push id17383
push userbmo:jyavenard@mozilla.com
push dateFri, 06 May 2016 06:16:15 +0000
reviewersgerald
bugs1269408
milestone49.0a1
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
dom/media/MediaFormatReader.cpp
--- 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);
     }
   }