Bug 219553 - Stop constructing unnecessary AudioBus in SincResampler
Summary: Stop constructing unnecessary AudioBus in SincResampler
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:
 
Reported: 2020-12-04 13:39 PST by Chris Dumez
Modified: 2020-12-04 14:40 PST (History)
10 users (show)

See Also:


Attachments
Patch (8.58 KB, patch)
2020-12-04 13:44 PST, 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-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>