[vlc-commits] opensles: use 10ms buffers
Rafaël Carré
git at videolan.org
Sat Feb 16 17:47:57 CET 2013
vlc | branch: master | Rafaël Carré <funman at videolan.org> | Fri Feb 15 16:15:08 2013 +0100| [ec1514442e90ec8fc7662f5121e236e2c5cab441] | committer: 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.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ec1514442e90ec8fc7662f5121e236e2c5cab441
---
modules/audio_output/opensles_android.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/modules/audio_output/opensles_android.c b/modules/audio_output/opensles_android.c
index d02b21c..4d75bf8 100644
--- a/modules/audio_output/opensles_android.c
+++ b/modules/audio_output/opensles_android.c
@@ -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) \
More information about the vlc-commits
mailing list