Bug 1447273 - Reduce AudioChunk::CanCombineWithFollowing indentation. r?padenot draft
authorAndreas Pehrson <pehrsons@mozilla.com>
Mon, 26 Mar 2018 18:33:09 +0200
changeset 778637 6b857882e2bd6e01933a2dde7272040ddcde1516
parent 775208 44aceee694bec3dc6a7757395d25553ae87ab166
child 778638 95d69312a8c73ca68e9d84d702ecdc6498ba6fde
push id105544
push userbvandyk@mozilla.com
push dateFri, 06 Apr 2018 15:56:09 +0000
reviewerspadenot
bugs1447273
milestone61.0a1
Bug 1447273 - Reduce AudioChunk::CanCombineWithFollowing indentation. r?padenot MozReview-Commit-ID: 9pk5xKrYoa6
dom/media/AudioSegment.h
--- a/dom/media/AudioSegment.h
+++ b/dom/media/AudioSegment.h
@@ -165,30 +165,31 @@ struct AudioChunk {
     mDuration = aEnd - aStart;
   }
   StreamTime GetDuration() const { return mDuration; }
   bool CanCombineWithFollowing(const AudioChunk& aOther) const
   {
     if (aOther.mBuffer != mBuffer) {
       return false;
     }
-    if (mBuffer) {
-      NS_ASSERTION(aOther.mBufferFormat == mBufferFormat,
-                   "Wrong metadata about buffer");
-      NS_ASSERTION(aOther.mChannelData.Length() == mChannelData.Length(),
-                   "Mismatched channel count");
-      if (mDuration > INT32_MAX) {
+    if (!mBuffer) {
+      return true;
+    }
+    NS_ASSERTION(aOther.mBufferFormat == mBufferFormat,
+                 "Wrong metadata about buffer");
+    NS_ASSERTION(aOther.mChannelData.Length() == mChannelData.Length(),
+                 "Mismatched channel count");
+    if (mDuration > INT32_MAX) {
+      return false;
+    }
+    for (uint32_t channel = 0; channel < mChannelData.Length(); ++channel) {
+      if (aOther.mChannelData[channel] != AddAudioSampleOffset(mChannelData[channel],
+          mBufferFormat, int32_t(mDuration))) {
         return false;
       }
-      for (uint32_t channel = 0; channel < mChannelData.Length(); ++channel) {
-        if (aOther.mChannelData[channel] != AddAudioSampleOffset(mChannelData[channel],
-            mBufferFormat, int32_t(mDuration))) {
-          return false;
-        }
-      }
     }
     return true;
   }
   bool IsNull() const {
     return mBuffer == nullptr;
   }
   void SetNull(StreamTime aDuration)
   {