highfidelity/hifi — pull request #3189 by wangyix (2014-07-22 00:21:28+00:00)
Title: Made Audio.cpp always push a whole number of frames to the audio output

Issue: when using the test tone with server echo, the client audio would sometimes suddenly become static-y and remain that way when the audio output overflow check was enabled.

Fix: the cause of this is that sometimes the audio output buffer would have room for an odd number of samples, which means the ring buffer would push an odd number of samples to the output buffer (hence why it's only an issue with the output overflow check enabled. If it weren't, the ring buffer would push all the samples it had every time).
To fix this, the code was revised so that only a whole number of frames can be pushed into the audio output.

Test: on mac with test tone and server echo enabled and the audio output overflow check enabled on hq, the static-y noise no longer occurred.