From a869f867d23db58c66bbc0692f55fcd0c17fd60e Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 7 May 2008 16:48:19 +0000 Subject: [PATCH] change buffering in pa git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8295 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/endpoints/mod_portaudio/pablio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mod/endpoints/mod_portaudio/pablio.c b/src/mod/endpoints/mod_portaudio/pablio.c index ab1d907e02..c4be4bc77f 100644 --- a/src/mod/endpoints/mod_portaudio/pablio.c +++ b/src/mod/endpoints/mod_portaudio/pablio.c @@ -143,7 +143,7 @@ long WriteAudioStream(PABLIO_Stream * aStream, void *data, long numFrames, switc */ long ReadAudioStream(PABLIO_Stream * aStream, void *data, long numFrames, switch_timer_t *timer) { - long bytesRead; + long bytesRead = 0; char *p = (char *) data; long avail, readBytes = 0, numBytes = aStream->bytesPerFrame * numFrames; @@ -154,8 +154,8 @@ long ReadAudioStream(PABLIO_Stream * aStream, void *data, long numFrames, switch PaUtil_FlushRingBuffer(&aStream->inFIFO); avail = 0; } - - if (avail >= numBytes) { + + if (avail >= numBytes * 2) { bytesRead = PaUtil_ReadRingBuffer(&aStream->inFIFO, p, numBytes); numBytes -= bytesRead; readBytes += bytesRead;