Bug 1332585 - Fix first frame duration being counted twice. r?jesup
MozReview-Commit-ID: HdHs1rpVUJK
--- a/dom/media/encoder/TrackEncoder.cpp
+++ b/dom/media/encoder/TrackEncoder.cpp
@@ -296,16 +296,17 @@ VideoTrackEncoder::AppendVideoSegment(co
continue;
}
// This is the first real chunk in the track. Use its timestamp as the
// starting point for this track.
MOZ_ASSERT(!chunk.mTimeStamp.IsNull());
const StreamTime nullDuration = mLastChunk.mDuration;
mLastChunk = chunk;
+ chunk.mDuration = 0;
TRACK_LOG(LogLevel::Verbose,
("[VideoTrackEncoder]: Got first video chunk after %lld ticks.",
nullDuration));
// Adapt to the time before the first frame. This extends the first frame
// from [start, end] to [0, end], but it'll do for now.
CheckedInt64 diff = FramesToUsecs(nullDuration, mTrackRate);
MOZ_ASSERT(diff.isValid());