snowcone-ltd / libmatoya

Cross-platform application development.
MIT License
578 stars 50 forks source link

Fix Android audio infinite flushing #134

Closed Kodikuu closed 3 months ago

Kodikuu commented 7 months ago

The Android audio callback will never request a number of frames smaller than the return value of AAudioStream_getFramesPerBurst.

If the audio buffer is flushing, but has less data than Android will ever request, then the buffer never empties and never stops trying to flush.

Instead, libmatoya should discard any frames below the what can be requested.