Bug 1447273 - Reduce AudioChunk::CanCombineWithFollowing indentation. r?padenot
MozReview-Commit-ID: 9pk5xKrYoa6
--- 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)
{