While looking into SIP stability issues on Android I've discovered that the
incoming call notification sound loops infinitely on AudioTrackRenderer.
It happend on AudioSystemClipImpl:runOnceInPlayThread:203, because
AudioTrackRenderer keept on returning INPUT_BUFFER_NOT_CONSUMED.
In AudioTrackRenderer:678 there is a check for written bytes count and
buffer length values. In situation when there were 2 bytes left and 0 were
written to the output it kept on returning the input not consumed. I've
changed the condition so that it will return OUTPUT_BUFFER_NOT_FILLED in
case when 0 bytes were written and the length is greater than zero.
AudioTrackRendererPatch.txt (1.03 KB)