Commit ec151444 authored by Rafaël Carré's avatar Rafaël Carré

opensles: use 10ms buffers

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.
parent 2a07b546
......@@ -42,10 +42,10 @@
#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) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment