+++ This bug was initially created as a clone of Bug #1184801 +++ AllocateAudioBlock() expects const_cast to be used to write data for its new chunk.
I first looked into returning float[WEBAUDIO_BLOCK_SIZE]* from AllocateAudioBlock in order to provide compile-time constraints on usage. That's probably possible, but would lose the feature of having all buffer info on the AudioChunk, so requires handling the buffers through two different objects and loses some run time channel count checking. It would also require a re-org in code like AudioBufferSourceNode, which makes late decisions on allocation. This approach is simple, keeps everything in one place, and provides run-time checking.
Attachment #8637723 - Flags: review?(padenot)
Attachment #8637723 - Flags: review?(padenot) → review+
Attachment #8637724 - Flags: review?(padenot) → review+
You need to log in before you can comment on or make changes to this bug.