[webkit-reviews] review granted: [Bug 216629] AnalyserNode.getFloatFrequencyData() should fill array with -Infinity when input is silent : [Attachment 408982] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Sep 17 01:09:29 PDT 2020


youenn fablet <youennf at gmail.com> has granted Chris Dumez <cdumez at apple.com>'s
request for review:
Bug 216629: AnalyserNode.getFloatFrequencyData() should fill array with
-Infinity when input is silent
https://bugs.webkit.org/show_bug.cgi?id=216629

Attachment 408982: Patch

https://bugs.webkit.org/attachment.cgi?id=408982&action=review




--- Comment #3 from youenn fablet <youennf at gmail.com> ---
Comment on attachment 408982
  --> https://bugs.webkit.org/attachment.cgi?id=408982
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=408982&action=review

> Source/WebCore/Modules/webaudio/RealtimeAnalyser.cpp:214
>	   float* destination = destinationArray.data();

auto

> Source/WebCore/Modules/webaudio/RealtimeAnalyser.cpp:218
>	       destination[i] = static_cast<float>(dbMag);

linearToDecibels returns a float, so there is probably no need for this double
to float cast.
One liner: destination[i] = AudioUtilities::linearToDecibels(source[i]);

> Source/WebCore/platform/audio/AudioUtilities.cpp:45
>  }

Might be worth inlining


More information about the webkit-reviews mailing list