Commit fa0bb17a authored by Andi-Bogdan Postelnicu's avatar Andi-Bogdan Postelnicu
Browse files

Bug 1660405 - Move away from mozilla::IsInfinite in favor of std::isinf....

Bug 1660405 - Move away from mozilla::IsInfinite in favor of std::isinf. r=nbp,media-playback-reviewers,alwu

Differential Revision: https://phabricator.services.mozilla.com/D173037
parent fa5d4cca
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1048,7 +1048,7 @@ void MediaDecoder::DurationChanged() {
  // See https://www.w3.org/Bugs/Public/show_bug.cgi?id=28822 for a discussion
  // of whether we should fire durationchange on explicit infinity.
  if (mFiredMetadataLoaded &&
      (!mozilla::IsInfinite<double>(mDuration) || mExplicitDuration.isSome())) {
      (!std::isinf(mDuration) || mExplicitDuration.isSome())) {
    GetOwner()->DispatchAsyncEvent(u"durationchange"_ns);
  }

+1 −1
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ class TimeUnit final {
  static TimeUnit FromSeconds(double aValue) {
    MOZ_ASSERT(!std::isnan(aValue));

    if (mozilla::IsInfinite<double>(aValue)) {
    if (std::isinf(aValue)) {
      return aValue > 0 ? FromInfinity() : FromNegativeInfinity();
    }
    // Due to internal double representation, this
+1 −1
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@ media::TimeIntervals MediaSourceDecoder::GetSeekable() {
  double duration = mMediaSource->Duration();
  if (std::isnan(duration)) {
    // Return empty range.
  } else if (duration > 0 && mozilla::IsInfinite(duration)) {
  } else if (duration > 0 && std::isinf(duration)) {
    media::TimeIntervals buffered = GetBuffered();

    // 1. If live seekable range is not empty:
+1 −1
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ inline float ConvertDecibelToLinear(float aDecibel) {
}

inline void FixNaN(double& aDouble) {
  if (std::isnan(aDouble) || IsInfinite(aDouble)) {
  if (std::isnan(aDouble) || std::isinf(aDouble)) {
    aDouble = 0.0;
  }
}
+4 −5
Original line number Diff line number Diff line
@@ -36,7 +36,6 @@
#include "WebAudioUtils.h"

using namespace mozilla::dom;  // for WebAudioUtils
using mozilla::IsInfinite;
using mozilla::MakeUnique;
using mozilla::PositiveInfinity;

@@ -293,7 +292,7 @@ void DynamicsCompressorKernel::process(

    // Fix gremlins.
    if (std::isnan(m_detectorAverage)) m_detectorAverage = 1;
    if (IsInfinite(m_detectorAverage)) m_detectorAverage = 1;
    if (std::isinf(m_detectorAverage)) m_detectorAverage = 1;

    float desiredGain = m_detectorAverage;

@@ -327,7 +326,7 @@ void DynamicsCompressorKernel::process(

      // Fix gremlins.
      if (std::isnan(compressionDiffDb)) compressionDiffDb = -1;
      if (IsInfinite(compressionDiffDb)) compressionDiffDb = -1;
      if (std::isinf(compressionDiffDb)) compressionDiffDb = -1;

      // Adaptive release - higher compression (lower compressionDiffDb)
      // releases faster.
@@ -355,7 +354,7 @@ void DynamicsCompressorKernel::process(

      // Fix gremlins.
      if (std::isnan(compressionDiffDb)) compressionDiffDb = 1;
      if (IsInfinite(compressionDiffDb)) compressionDiffDb = 1;
      if (std::isinf(compressionDiffDb)) compressionDiffDb = 1;

      // As long as we're still in attack mode, use a rate based off
      // the largest compressionDiffDb we've encountered so far.
@@ -427,7 +426,7 @@ void DynamicsCompressorKernel::process(

        // Fix gremlins.
        if (std::isnan(detectorAverage)) detectorAverage = 1;
        if (IsInfinite(detectorAverage)) detectorAverage = 1;
        if (std::isinf(detectorAverage)) detectorAverage = 1;

        // Exponential approach to desired gain.
        if (envelopeRate < 1) {
Loading