Bug 1394656 - Don't include nsAlgorithm.h in AudioSampleFormat.h. r?jwwang
There's nothing in nsAlgorithm.h that we're using in AudioSampleFormat.h,
though it does pull in the definition of NS_ASSERTION(), which we can
replace with an MFBT assertion to simplyfy the include graph.
MozReview-Commit-ID: EXOv2t0hKDc
--- a/dom/media/AudioSampleFormat.h
+++ b/dom/media/AudioSampleFormat.h
@@ -1,17 +1,17 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef MOZILLA_AUDIOSAMPLEFORMAT_H_
#define MOZILLA_AUDIOSAMPLEFORMAT_H_
-#include "nsAlgorithm.h"
+#include "mozilla/Assertions.h"
#include <algorithm>
namespace mozilla {
/**
* Audio formats supported in MediaStreams and media elements.
*
* Only one of these is supported by AudioStream, and that is determined
@@ -243,17 +243,16 @@ ScaleAudioSamples(short* aBuffer, int aC
}
inline const void*
AddAudioSampleOffset(const void* aBase, AudioSampleFormat aFormat,
int32_t aOffset)
{
static_assert(AUDIO_FORMAT_S16 == 0, "Bad constant");
static_assert(AUDIO_FORMAT_FLOAT32 == 1, "Bad constant");
- NS_ASSERTION(aFormat == AUDIO_FORMAT_S16 || aFormat == AUDIO_FORMAT_FLOAT32,
- "Unknown format");
+ MOZ_ASSERT(aFormat == AUDIO_FORMAT_S16 || aFormat == AUDIO_FORMAT_FLOAT32);
return static_cast<const uint8_t*>(aBase) + (aFormat + 1)*2*aOffset;
}
} // namespace mozilla
#endif /* MOZILLA_AUDIOSAMPLEFORMAT_H_ */