Bug 1447273 - Reduce AudioChunk::CanCombineWithFollowing indentation. r?padenot draft
authorAndreas Pehrson <pehrsons@mozilla.com>
Mon, 26 Mar 2018 18:33:09 +0200
changeset 772607 83c484b43082f2bf9bb79ccb470cb5ab5f8a9691
parent 771093 7771df14ea181add1dc4133f0f5559bf620bf976
child 772608 0aa21aba74275f24314924f883d16bd5f9ee2a50
push id103985
push userbmo:apehrson@mozilla.com
push dateMon, 26 Mar 2018 16:34:40 +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)
   {