Bug 216629 - AnalyserNode.getFloatFrequencyData() should fill array with -Infinity when input is silent
Summary: AnalyserNode.getFloatFrequencyData() should fill array with -Infinity when in...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Audio (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks: 212611
  Show dependency treegraph
 
Reported: 2020-09-16 18:05 PDT by Chris Dumez
Modified: 2020-09-17 11:40 PDT (History)
10 users (show)

See Also:


Attachments
Patch (4.65 KB, patch)
2020-09-16 18:07 PDT, Chris Dumez
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch (5.48 KB, patch)
2020-09-16 19:41 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (6.55 KB, patch)
2020-09-17 08:36 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (6.54 KB, patch)
2020-09-17 09:17 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2020-09-16 18:05:11 PDT
AnalyserNode.getFloatFrequencyData() should fill array with -Infinity when input is silent.
Comment 1 Chris Dumez 2020-09-16 18:07:02 PDT
Created attachment 408972 [details]
Patch
Comment 2 Chris Dumez 2020-09-16 19:41:21 PDT
Created attachment 408982 [details]
Patch
Comment 3 youenn fablet 2020-09-17 01:09:29 PDT
Comment on attachment 408982 [details]
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
Comment 4 Chris Dumez 2020-09-17 08:36:03 PDT
Created attachment 409034 [details]
Patch
Comment 5 Chris Dumez 2020-09-17 09:17:03 PDT
Created attachment 409040 [details]
Patch
Comment 6 EWS 2020-09-17 11:39:29 PDT
Committed r267202: <https://trac.webkit.org/changeset/267202>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 409040 [details].
Comment 7 Radar WebKit Bug Importer 2020-09-17 11:40:17 PDT
<rdar://problem/69084553>