Bug 219553

Summary: Stop constructing unnecessary AudioBus in SincResampler
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: Web AudioAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, darin, eric.carlson, ews-watchlist, ggaren, glenn, jer.noble, philipj, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Chris Dumez 2020-12-04 13:39:54 PST
Stop constructing unnecessary AudioBus in SincResampler. Instead, pass the float* buffer to the lambda directly.
Comment 1 Chris Dumez 2020-12-04 13:44:53 PST
Created attachment 415455 [details]
Patch
Comment 2 Darin Adler 2020-12-04 14:31:58 PST
Comment on attachment 415455 [details]
Patch

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

> Source/WebCore/platform/audio/MultiChannelResampler.cpp:56
> +    void provideInputForChannel(float* buffer, size_t framesToProcess, unsigned channelIndex)

Surprised that this function can just return and do nothing, with no indication to the caller. But that’s not new.
Comment 3 Chris Dumez 2020-12-04 14:34:15 PST
Comment on attachment 415455 [details]
Patch

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

>> Source/WebCore/platform/audio/MultiChannelResampler.cpp:56
>> +    void provideInputForChannel(float* buffer, size_t framesToProcess, unsigned channelIndex)
> 
> Surprised that this function can just return and do nothing, with no indication to the caller. But that’s not new.

I actually does not in practice. You can see that there are assertions for all conditions where we early return. For some reason though, the person who wrote this code did both assertions and early return in release if the assertion would have failed.
Comment 4 Chris Dumez 2020-12-04 14:39:40 PST
Comment on attachment 415455 [details]
Patch

Clearing flags on attachment: 415455

Committed r270460: <https://trac.webkit.org/changeset/270460>
Comment 5 Chris Dumez 2020-12-04 14:39:42 PST
All reviewed patches have been landed.  Closing bug.
Comment 6 Radar WebKit Bug Importer 2020-12-04 14:40:27 PST
<rdar://problem/71994027>