On return, ioOutputDataByteSize is supposed to contain the number of
bytes the codec wrote to the buffer pointed to by outOutputData. If
you are writing a codec, you should always follow the semantics of
the Audio Codec API regardless of what the layers above are doing
with the values you return. You never know when those layers are
going to change, so it's best to just follow the rules here.
Also, there's no requirement that the caller of
AudioCodecProduceOutputPackets use what you return in
ioOutputDataByteSize. The reason why is that it is, in a lot of ways,
redundant information when you already know the format of the data
(and thus know the bytes per packet) or, in the case of VBR formats,
you have the packet descriptions.