From ffdbc957a7867502dbcdd988b3571333047aa42f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <adrien.beraud@savoirfairelinux.com>
Date: Thu, 12 Nov 2015 14:09:50 -0500
Subject: [PATCH] audio: reduce default ring buffer size

Current size was defined before the LibAV jitter buffer
was introduced. The buffer size defined was already very
conservative: 32000 samples means 2/3 of a second (an eternity).

* reduce buffer size to 16000 samples (333 ms at 48kHz)
* reduces audio latency of up to 333 ms
* should slightly improve echo cancelling

Tuleap: #120
Change-Id: I0c3d4f83d18f4fdede7e89cd9a36327af716c1ca
---
 src/ring_types.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/ring_types.h b/src/ring_types.h
index 2f11ca8b33..c864d1603d 100644
--- a/src/ring_types.h
+++ b/src/ring_types.h
@@ -2,6 +2,7 @@
  *  Copyright (C) 2004-2015 Savoir-faire Linux Inc.
  *
  *  Author: Tristan Matthews <tristan.matthews@savoirfairelinux.com>
+ *  Author: Adrien Béraud <adrien.beraud@savoirfairelinux.com>
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -30,7 +31,7 @@ namespace ring {
 
 typedef int16_t AudioSample;
 
-static constexpr size_t SIZEBUF = 32000; /** About 1s of buffering at 48kHz */
+static constexpr size_t SIZEBUF = 16000; /** About 62.5ms of buffering at 48kHz */
 
 /**
  * This meta-function is used to enable a template overload
-- 
GitLab