Bug 1261007 - Part 3 - Remove the same/redundant code of checking the unique image. r=jolin
authorbechen <bechen@mozilla.com>
Mon, 18 Apr 2016 14:31:02 +0800
changeset 331916 a1da3524fc2509c7c0db6f30c5594c9a71a2c168
parent 331915 5e3441e1a4c1e89d2502d744fe1a666d1731cc4c
child 331917 b0eb077d0e891e4c8c28fca80a1e878657c5b16f
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjolin
bugs1261007
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1261007 - Part 3 - Remove the same/redundant code of checking the unique image. r=jolin MozReview-Commit-ID: ByLCFShcN8q
dom/media/encoder/OmxTrackEncoder.cpp
--- a/dom/media/encoder/OmxTrackEncoder.cpp
+++ b/dom/media/encoder/OmxTrackEncoder.cpp
@@ -108,26 +108,22 @@ OmxVideoTrackEncoder::GetEncodedTrack(En
   }
 
   nsresult rv;
   // Start queuing raw frames to the input buffers of OMXCodecWrapper.
   VideoSegment::ChunkIterator iter(segment);
   while (!iter.IsEnded()) {
     VideoChunk chunk = *iter;
 
-    // Send only the unique video frames to OMXCodecWrapper.
-    if (mLastFrame != chunk.mFrame) {
-      uint64_t totalDurationUs = mTotalFrameDuration * USECS_PER_S / mTrackRate;
-      layers::Image* img = (chunk.IsNull() || chunk.mFrame.GetForceBlack()) ?
-                           nullptr : chunk.mFrame.GetImage();
-      rv = mEncoder->Encode(img, mFrameWidth, mFrameHeight, totalDurationUs);
-      NS_ENSURE_SUCCESS(rv, rv);
-    }
+    uint64_t totalDurationUs = mTotalFrameDuration * USECS_PER_S / mTrackRate;
+    layers::Image* img = (chunk.IsNull() || chunk.mFrame.GetForceBlack()) ?
+                         nullptr : chunk.mFrame.GetImage();
+    rv = mEncoder->Encode(img, mFrameWidth, mFrameHeight, totalDurationUs);
+    NS_ENSURE_SUCCESS(rv, rv);
 
-    mLastFrame.TakeFrom(&chunk.mFrame);
     mTotalFrameDuration += chunk.GetDuration();
 
     iter.Next();
   }
 
   // Send the EOS signal to OMXCodecWrapper.
   if (mEndOfStream && iter.IsEnded() && !mEosSetInEncoder) {
     uint64_t totalDurationUs = mTotalFrameDuration * USECS_PER_S / mTrackRate;