From 4dd24a9173f6645b67939891233e47dd88a4407f Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Sat, 30 Jan 2016 18:22:19 +0000 Subject: [PATCH] avoid buffer length of one for the auto jitter buffer detection --- src/buffer.cpp | 26 ++++++++++++++------------ src/buffer.h | 2 +- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/buffer.cpp b/src/buffer.cpp index f9e90a66..1662afea 100755 --- a/src/buffer.cpp +++ b/src/buffer.cpp @@ -93,19 +93,21 @@ bool CNetBuf::Get ( CVector& vecbyData, CNetBufWithStats::CNetBufWithStats() : CNetBuf ( false ) // base class init: no simulation mode { - // define the sizes of the simulation buffers, + // Define the sizes of the simulation buffers, // must be NUM_STAT_SIMULATION_BUFFERS elements! - viBufSizesForSim[0] = 1; - viBufSizesForSim[1] = 2; - viBufSizesForSim[2] = 3; - viBufSizesForSim[3] = 4; - viBufSizesForSim[4] = 5; - viBufSizesForSim[5] = 6; - viBufSizesForSim[6] = 7; - viBufSizesForSim[7] = 8; - viBufSizesForSim[8] = 9; - viBufSizesForSim[9] = 10; - viBufSizesForSim[10] = 11; + // Avoid the buffer length 1 because we do not have a solution for a + // sample rate offset correction. Caused by the jitter we usually get bad + // performance with just one buffer. + viBufSizesForSim[0] = 2; + viBufSizesForSim[1] = 3; + viBufSizesForSim[2] = 4; + viBufSizesForSim[3] = 5; + viBufSizesForSim[4] = 6; + viBufSizesForSim[5] = 7; + viBufSizesForSim[6] = 8; + viBufSizesForSim[7] = 9; + viBufSizesForSim[8] = 10; + viBufSizesForSim[9] = 11; // set all simulation buffers in simulation mode for ( int i = 0; i < NUM_STAT_SIMULATION_BUFFERS; i++ ) diff --git a/src/buffer.h b/src/buffer.h index 79039bf0..5fb4e104 100755 --- a/src/buffer.h +++ b/src/buffer.h @@ -43,7 +43,7 @@ #define UP_MAX_ERROR_BOUND 0.01 // number of simulation network jitter buffers for evaluating the statistic -#define NUM_STAT_SIMULATION_BUFFERS 11 +#define NUM_STAT_SIMULATION_BUFFERS 10 /* Classes ********************************************************************/