Bug 62046

Summary: Allow existing AudioParams to use scheduled parameter changes
Product: WebKit Reporter: Chris Rogers <crogers>
Component: Web AudioAssignee: Chris Rogers <crogers>
Status: RESOLVED FIXED    
Severity: Normal CC: crogers, kbr
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch kbr: review+

Description Chris Rogers 2011-06-03 13:17:53 PDT
Allow existing AudioParams to use scheduled parameter changes
Comment 1 Chris Rogers 2011-06-03 13:24:53 PDT
Created attachment 95956 [details]
Patch
Comment 2 Kenneth Russell 2011-06-03 13:42:10 PDT
Comment on attachment 95956 [details]
Patch

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

Looks good to me. One minor comment.

> Source/WebCore/platform/audio/AudioBus.cpp:385
> +            const float* source = sourceBus.channel(channelIndex)->data();
> +            float* destination = channel(channelIndex)->data();
> +            for (unsigned i = 0; i < numberOfGainValues; ++i)
> +                destination[i] = source[i] * gainValues[i];
> +        }
> +    } else if (sourceBus.numberOfChannels() == 1) {
> +        const float* source = sourceBus.channel(0)->data();
> +        for (unsigned channelIndex = 0; channelIndex < numberOfChannels(); ++channelIndex) {
> +            float* destination = channel(channelIndex)->data();
> +            for (unsigned i = 0; i < numberOfGainValues; ++i)
> +                destination[i] = source[i] * gainValues[i];

Would be nice to avoid the duplicated code.
Comment 3 Chris Rogers 2011-06-03 14:18:21 PDT
Comment on attachment 95956 [details]
Patch

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

>> Source/WebCore/platform/audio/AudioBus.cpp:385
>> +                destination[i] = source[i] * gainValues[i];
> 
> Would be nice to avoid the duplicated code.

Agreed.  I'll try to coalesce these two cases.
Comment 4 Chris Rogers 2011-06-03 16:03:17 PDT
Committed r88074: <http://trac.webkit.org/changeset/88074>