WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
66830
AudioPannerNode::setPanningModel() does not update m_panningModel properly
https://bugs.webkit.org/show_bug.cgi?id=66830
Summary
AudioPannerNode::setPanningModel() does not update m_panningModel properly
Chris Rogers
Reported
2011-08-23 17:51:32 PDT
AudioPannerNode::setPanningModel() correctly creates a new panner object of the correct type, but does not update m_panningModel properly. So the .panningModel attribute will not show the new model.
Attachments
Patch
(5.57 KB, patch)
2012-01-23 13:52 PST
,
Raymond Toy
no flags
Details
Formatted Diff
Diff
Patch
(5.58 KB, patch)
2012-01-23 14:32 PST
,
Raymond Toy
no flags
Details
Formatted Diff
Diff
Patch
(4.85 KB, patch)
2012-01-25 16:13 PST
,
Raymond Toy
no flags
Details
Formatted Diff
Diff
Patch
(5.34 KB, patch)
2012-01-26 16:06 PST
,
Raymond Toy
no flags
Details
Formatted Diff
Diff
Patch
(6.35 KB, patch)
2012-01-26 18:59 PST
,
Raymond Toy
no flags
Details
Formatted Diff
Diff
Patch
(6.36 KB, patch)
2012-01-26 19:35 PST
,
Raymond Toy
no flags
Details
Formatted Diff
Diff
Patch
(6.38 KB, patch)
2012-01-27 12:42 PST
,
Raymond Toy
no flags
Details
Formatted Diff
Diff
Patch
(6.46 KB, patch)
2012-01-27 15:20 PST
,
Raymond Toy
no flags
Details
Formatted Diff
Diff
Show Obsolete
(7)
View All
Add attachment
proposed patch, testcase, etc.
Raymond Toy
Comment 1
2011-11-18 14:10:41 PST
Is the fix as simple as adding m_panningModel = model in AudioPannerNode::setPanningModel in AudioPannerNode.cpp?
Chris Rogers
Comment 2
2012-01-05 22:00:58 PST
(In reply to
comment #1
)
> Is the fix as simple as adding m_panningModel = model in AudioPannerNode::setPanningModel in AudioPannerNode.cpp?
It seems as simple as that :)
Raymond Toy
Comment 3
2012-01-23 13:52:04 PST
Created
attachment 123615
[details]
Patch
WebKit Review Bot
Comment 4
2012-01-23 13:59:15 PST
Attachment 123615
[details]
did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/weba..." exit_code: 1 Source/WebCore/ChangeLog:12: Line contains tab character. [whitespace/tab] [5] Total errors found: 1 in 5 files If any of these errors are false positives, please file a bug against check-webkit-style.
Raymond Toy
Comment 5
2012-01-23 14:32:13 PST
Created
attachment 123622
[details]
Patch
Chris Rogers
Comment 6
2012-01-25 15:08:12 PST
Comment on
attachment 123622
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=123622&action=review
> LayoutTests/webaudio/panner-set-model.html:77 > + createTestAndRun(context);
This test seems more complicated than necessary. Can't we just create a single AudioPannerNode and then set the panningModel attribute for each of the constant values, then check that the attribute returns the same value? Then we can get rid of createTestAndRun() and all of the associated testing machinery around.
Raymond Toy
Comment 7
2012-01-25 16:12:53 PST
Comment on
attachment 123622
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=123622&action=review
>> LayoutTests/webaudio/panner-set-model.html:77 >> + createTestAndRun(context); > > This test seems more complicated than necessary. Can't we just create a single AudioPannerNode and then set the panningModel attribute for each of the constant values, then check that the attribute returns the same value? > > Then we can get rid of createTestAndRun() and all of the associated testing machinery around.
Simplified test as suggested.
Raymond Toy
Comment 8
2012-01-25 16:13:13 PST
Created
attachment 124031
[details]
Patch
Chris Rogers
Comment 9
2012-01-25 16:44:20 PST
Comment on
attachment 124031
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=124031&action=review
> Source/WebCore/webaudio/AudioPannerNode.cpp:155 > if (!m_panner.get() || model != m_panningModel) {
I just noticed that we should do bounds checking on "model" and reject illegal values
> LayoutTests/webaudio/panner-set-model.html:18 > + var renderLengthSeconds = 0.001;
We don't need these two variables since we don't need to use an offline audio context.
> LayoutTests/webaudio/panner-set-model.html:30 > + var context = new webkitAudioContext(2, sampleRate * renderLengthSeconds, sampleRate);
I think we can use a "regular" AudioContext here (no constructor arguments)
> LayoutTests/webaudio/panner-set-model.html:36 > + // correctly.
We should add a comment describing the "magic" number 3, describing the existing panning constant values...
> LayoutTests/webaudio/panner-set-model.html:43 > + success = false;
nit: extra space before "success"
> LayoutTests/webaudio/panner-set-model.html:45 > + }
We can add a test case where we try to set the panning model to an illegal value, and make sure it doesn't get set to that value.
> LayoutTests/webaudio/panner-set-model.html:54 > +
nit: extra blank line
Raymond Toy
Comment 10
2012-01-26 08:17:38 PST
Comment on
attachment 124031
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=124031&action=review
>> LayoutTests/webaudio/panner-set-model.html:36 >> + // correctly. > > We should add a comment describing the "magic" number 3, describing the existing panning constant values...
Do you want to say something more than that there are currently 3 panner models numbered 0 to 2?
>> LayoutTests/webaudio/panner-set-model.html:45 >> + } > > We can add a test case where we try to set the panning model to an illegal value, and make sure it doesn't get set to that value.
I tried setting the model to 99. .panningModel is 99. Maybe we shouldn't add this test now and file a bug report about it and fix it there, updating this test appropriately?
Chris Rogers
Comment 11
2012-01-26 11:21:56 PST
(In reply to
comment #10
)
> (From update of
attachment 124031
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=124031&action=review
> > >> LayoutTests/webaudio/panner-set-model.html:36 > >> + // correctly. > > > > We should add a comment describing the "magic" number 3, describing the existing panning constant values... > > Do you want to say something more than that there are currently 3 panner models numbered 0 to 2?
Ideally, we wouldn't even have a loop and would create a testing function and do something like this: testSet(panner.EQUALPOWER); testSet(panner.HRTF); testSet(panner.SOUNDFIELD);
> > >> LayoutTests/webaudio/panner-set-model.html:45 > >> + } > > > > We can add a test case where we try to set the panning model to an illegal value, and make sure it doesn't get set to that value. > > I tried setting the model to 99. .panningModel is 99. Maybe we shouldn't add this test now and file a bug report about it and fix it there, updating this test appropriately?
In another comment about the C++ implementation, I mention we should be doing bounds checking...
Raymond Toy
Comment 12
2012-01-26 16:06:54 PST
Created
attachment 124203
[details]
Patch
Chris Rogers
Comment 13
2012-01-26 17:09:09 PST
Comment on
attachment 124203
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=124203&action=review
> Source/WebCore/webaudio/AudioPannerNode.cpp:155 > if (!m_panner.get() || model != m_panningModel) {
Please do bounds checking on "model" and silently fail if model is not valid
> LayoutTests/webaudio/panner-set-model.html:55 > +
Please add one additional test setting to an illegal value and validating that the value did *not* change.
Raymond Toy
Comment 14
2012-01-26 18:59:13 PST
Created
attachment 124234
[details]
Patch
Raymond Toy
Comment 15
2012-01-26 19:01:25 PST
(In reply to
comment #13
)
> (From update of
attachment 124203
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=124203&action=review
> > > Source/WebCore/webaudio/AudioPannerNode.cpp:155 > > if (!m_panner.get() || model != m_panningModel) { > > Please do bounds checking on "model" and silently fail if model is not valid
Done. Not sure if this is how you want me to test for a valid model, though.
> > > LayoutTests/webaudio/panner-set-model.html:55 > > + > > Please add one additional test setting to an illegal value and validating that the value did *not* change.
Done.
WebKit Review Bot
Comment 16
2012-01-26 19:04:01 PST
Attachment 124234
[details]
did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/weba..." exit_code: 1 Source/WebCore/ChangeLog:13: Line contains tab character. [whitespace/tab] [5] Total errors found: 1 in 5 files If any of these errors are false positives, please file a bug against check-webkit-style.
Raymond Toy
Comment 17
2012-01-26 19:35:04 PST
Created
attachment 124240
[details]
Patch
Chris Rogers
Comment 18
2012-01-27 10:31:41 PST
Comment on
attachment 124240
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=124240&action=review
Looks great if the comments are addressed.
> Source/WebCore/webaudio/AudioPannerNode.cpp:166 > + // Silently fail, without doing anything.
I wouldn't use the word "fail" since it implies a defect in the implementation. How about: // Ignore illegal panner values. Or, even better yet, no comment at all since it's quite obvious from the code itself. WebKit style is to try to avoid obvious comments. One thing we could consider is throwing an exception here, so another option is: // FIXME: consider throwing exception for illegal model value.
> LayoutTests/webaudio/panner-set-model.html:62 > + testFailed("Panner set to invalid model, but the panningModel changed fomr 2 to " + panner.panningModel);
typo: "fomr" -> "from"
Raymond Toy
Comment 19
2012-01-27 12:42:27 PST
Created
attachment 124352
[details]
Patch
Raymond Toy
Comment 20
2012-01-27 12:43:48 PST
Comment on
attachment 124240
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=124240&action=review
>> Source/WebCore/webaudio/AudioPannerNode.cpp:166 >> + // Silently fail, without doing anything. > > I wouldn't use the word "fail" since it implies a defect in the implementation. How about: > > // Ignore illegal panner values. > > Or, even better yet, no comment at all since it's quite obvious from the code itself. WebKit style is to try to avoid obvious comments. > > One thing we could consider is throwing an exception here, so another option is: > > // FIXME: consider throwing exception for illegal model value.
Added FIXME comment. Will file a bug on this so we don't forget.
>> LayoutTests/webaudio/panner-set-model.html:62 >> + testFailed("Panner set to invalid model, but the panningModel changed fomr 2 to " + panner.panningModel); > > typo: "fomr" -> "from"
Fixed.
Chris Rogers
Comment 21
2012-01-27 13:06:27 PST
Looks good.
Kenneth Russell
Comment 22
2012-01-27 13:54:08 PST
Comment on
attachment 124352
[details]
Patch rs=me
WebKit Review Bot
Comment 23
2012-01-27 15:06:42 PST
Comment on
attachment 124352
[details]
Patch Rejecting
attachment 124352
[details]
from commit-queue. Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2 Last 500 characters of output: t/git/webkit-commit-queue/Source/WebKit/chromium/v8 --revision 10507 --non-interactive --force --accept theirs-conflict --ignore-externals' in '/mnt/git/webkit-commit-queue/Source/WebKit/chromium' 46>At revision 10507. ________ running '/usr/bin/python tools/clang/scripts/update.py --mac-only' in '/mnt/git/webkit-commit-queue/Source/WebKit/chromium' ________ running '/usr/bin/python gyp_webkit' in '/mnt/git/webkit-commit-queue/Source/WebKit/chromium' Updating webkit projects from gyp files... Full output:
http://queues.webkit.org/results/11360166
Raymond Toy
Comment 24
2012-01-27 15:20:01 PST
Created
attachment 124380
[details]
Patch
Raymond Toy
Comment 25
2012-01-27 15:21:29 PST
Update patch to current sources. Only changed the changelogs.
Kenneth Russell
Comment 26
2012-01-27 15:41:35 PST
Comment on
attachment 124380
[details]
Patch r=me again
WebKit Review Bot
Comment 27
2012-01-27 19:11:58 PST
Comment on
attachment 124380
[details]
Patch Clearing flags on attachment: 124380 Committed
r106174
: <
http://trac.webkit.org/changeset/106174
>
WebKit Review Bot
Comment 28
2012-01-27 19:12:03 PST
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug