Bug 1261007 - part3: Remove the same/redundant code of checking the unique image. r=jolin draft
authorbechen <bechen@mozilla.com>
Mon, 18 Apr 2016 14:31:02 +0800
changeset 352396 a064ba135d2cfe4f46468ba9dfc04c31aea0aef4
parent 352395 a14a84bee2db7fd9ac4edc0aef825dfc38feee5d
child 355217 73d610774539516fdb50c371f14fbf10d6a735e5
push id15701
push userbechen@mozilla.com
push dateMon, 18 Apr 2016 06:53:43 +0000
reviewersjolin
bugs1261007
milestone48.0a1
Bug 1261007 - part3: 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;