Bug 62046 - Allow existing AudioParams to use scheduled parameter changes
Summary: Allow existing AudioParams to use scheduled parameter changes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Audio (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Rogers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-03 13:17 PDT by Chris Rogers
Modified: 2011-06-03 16:03 PDT (History)
2 users (show)

See Also:


Attachments
Patch (9.40 KB, patch)
2011-06-03 13:24 PDT, Chris Rogers
kbr: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>