[Webkit-unassigned] [Bug 67952] Ask for audio hardware buffer size instead of using hardwired constants.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Sep 19 10:59:20 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=67952





--- Comment #25 from Raymond Toy <rtoy at chromium.org>  2011-09-19 10:59:20 PST ---
(From update of attachment 107710)
View in context: https://bugs.webkit.org/attachment.cgi?id=107710&action=review

>>>> Source/WebKit/chromium/src/AudioDestinationChromium.cpp:47
>>>> +const size_t minimumCallbackBufferSize = 128;
>>> 
>>> I wouldn't create a new constant here, but instead use the already existing constant "renderBufferSize"
>> 
>> Although they have the same value, they're conceptually different things.  Do you think overloading the meaning is appropriate?
> 
> The problem with having two different constants is that one could be changed, and the other value would no longer be consistent.  I think two values would be more bug prone.  If you really wanted two constants then you could define one in terms of the other (equal to the other).  But this really seems overkill.

Fair enough.  I'll make the change.  (Actually, as long as  callbackSize is not 0, it is rounded up to a multiple of renderBufferSize anyway since we're testing m_callbackBufferSize, not callbackSize.  Maybe just test against 1 instead of renderBufferSize?)

>>>> Source/WebKit/chromium/src/AudioDestinationChromium.cpp:74
>>>> +    ASSERT((minimumCallbackBuffersize <= m_callbackBuffersize)
>>> 
>>> I would suggest something like this:
>>> 
>>> bool isSizeGood = m_callbackBuffersize >= renderBufferSize && m_callbackBuffersize <= maximumCallbackBufferSize;
>>> ASSERT(isSizeGood);
>>> if (!isSizeGood)
>>>     return;
>> 
>> Yes, I'll do this in the next patch.
> 
> 

Done.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list