Bug 1332585 - Fix first frame duration being counted twice. r?jesup draft
authorAndreas Pehrson <pehrsons@gmail.com>
Fri, 20 Jan 2017 11:50:07 +0100
changeset 464235 b4b284c0bce5f2eb6844eef78f1f7d445057b84b
parent 464234 d3480dc22e30c6a0aa28a9122b9289bf50703985
child 464236 3b4820bc1fc83dba9f621cb0ba0bafe09c2f303f
push id42309
push userbmo:pehrson@telenordigital.com
push dateFri, 20 Jan 2017 18:13:48 +0000
reviewersjesup
bugs1332585
milestone53.0a1
Bug 1332585 - Fix first frame duration being counted twice. r?jesup MozReview-Commit-ID: HdHs1rpVUJK
dom/media/encoder/TrackEncoder.cpp
--- 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());