Bug 85818 - JavaScriptAudioNode should not ASSERT if number of input channels is 0
Summary: JavaScriptAudioNode should not ASSERT if number of input channels is 0
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: Raymond Toy
URL:
Keywords:
Depends on:
Blocks: 84743
  Show dependency treegraph
 
Reported: 2012-05-07 12:50 PDT by Raymond Toy
Modified: 2012-05-08 16:23 PDT (History)
4 users (show)

See Also:


Attachments
Patch (6.08 KB, patch)
2012-05-07 14:23 PDT, Raymond Toy
no flags Details | Formatted Diff | Diff
Patch (6.51 KB, patch)
2012-05-08 11:44 PDT, Raymond Toy
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Raymond Toy 2012-05-07 12:50:06 PDT
It is valid to have 0 input channels for a JavaScriptAudioNode, so we shouldn't ASSERT in that case.
Comment 1 Raymond Toy 2012-05-07 14:23:44 PDT
Created attachment 140592 [details]
Patch
Comment 2 Chris Rogers 2012-05-07 17:17:15 PDT
Comment on attachment 140592 [details]
Patch

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

Hi Ray, thanks very much for the fix and layout test.  Just a few nits:

> LayoutTests/webaudio/javascriptaudionode-zero-input-channels.html:7
> +<title>JavaScriptAudioNode</title>

<title> line should be removed

> LayoutTests/webaudio/javascriptaudionode-zero-input-channels.html:35
> +    var context = new webkitAudioContext(1, 44100, 44100);

Best not to use hard-coded values here, and instead use the exact same pattern as the other JavaScriptAudioNode tests such as "javascriptaudionode.html"

> LayoutTests/webaudio/javascriptaudionode-zero-input-channels.html:36
> +    var node = context.createJavaScriptNode(4096, 0, 2);

Please put this creation in a try/catch block to check for exceptions here

> LayoutTests/webaudio/javascriptaudionode-zero-input-channels.html:40
> +

Please add short comment explaining that the onaudioprocess function is doing nothing since we simply want to make sure that the processing logic in the implementation can handle 0 input channels and don't care about doing any processing.
You might want to add a FIXME explaining that we could check the .inputBuffer attribute of the AudioProcessingEvent appropriately (don't need to add that part right now).
Comment 3 Raymond Toy 2012-05-08 11:44:14 PDT
Created attachment 140753 [details]
Patch
Comment 4 Raymond Toy 2012-05-08 11:46:03 PDT
Comment on attachment 140592 [details]
Patch

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

>> LayoutTests/webaudio/javascriptaudionode-zero-input-channels.html:7
>> +<title>JavaScriptAudioNode</title>
> 
> <title> line should be removed

Done.

>> LayoutTests/webaudio/javascriptaudionode-zero-input-channels.html:35
>> +    var context = new webkitAudioContext(1, 44100, 44100);
> 
> Best not to use hard-coded values here, and instead use the exact same pattern as the other JavaScriptAudioNode tests such as "javascriptaudionode.html"

Done.

>> LayoutTests/webaudio/javascriptaudionode-zero-input-channels.html:40
>> +
> 
> Please add short comment explaining that the onaudioprocess function is doing nothing since we simply want to make sure that the processing logic in the implementation can handle 0 input channels and don't care about doing any processing.
> You might want to add a FIXME explaining that we could check the .inputBuffer attribute of the AudioProcessingEvent appropriately (don't need to add that part right now).

Comment and FIXME added.
Comment 5 Eric Seidel (no email) 2012-05-08 16:14:07 PDT
Comment on attachment 140753 [details]
Patch

Seems reasonable.
Comment 6 WebKit Review Bot 2012-05-08 16:23:20 PDT
Comment on attachment 140753 [details]
Patch

Clearing flags on attachment: 140753

Committed r116465: <http://trac.webkit.org/changeset/116465>
Comment 7 WebKit Review Bot 2012-05-08 16:23:25 PDT
All reviewed patches have been landed.  Closing bug.