This rounds up to exactly 441 samples with 44.1kHz audio
This avoids a rounding error in drift calculation of 2.31 milliseconds
in the worst case of the buffers queue being full for the specific
case of 44.1kHz audio (such a small error is not significative).
For unknown reasons it also fixes A/V sync issues.
#include <SLES/OpenSLES_Android.h>
#define OPENSLES_BUFFERS 255 /* maximum number of buffers */
-#define OPENSLES_BUFLEN 4 /* ms */
+#define OPENSLES_BUFLEN 10 /* ms */
/*
- * 4ms of precision when mesasuring latency should be plenty enough,
- * with 255 buffers we can buffer ~1s of audio.
+ * 10ms of precision when mesasuring latency should be enough,
+ * with 255 buffers we can buffer 2.55s of audio.
*/
#define CHECK_OPENSL_ERROR(msg) \