]> git.sesse.net Git - vlc/commitdiff
opensles: use 10ms buffers
authorRafaël Carré <funman@videolan.org>
Fri, 15 Feb 2013 15:15:08 +0000 (16:15 +0100)
committerRafaël Carré <funman@videolan.org>
Sat, 16 Feb 2013 16:46:52 +0000 (17:46 +0100)
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.

modules/audio_output/opensles_android.c

index d02b21c691592cfc9bb6c54c120b00d0abf08810..4d75bf86bb36f6d7a76f1ac38713aeac0fd86297 100644 (file)
 #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)                \