[Freeswitch-svn] [commit] r8295 - freeswitch/trunk/src/mod/endpoints/mod_portaudio
Freeswitch SVN
anthm at freeswitch.org
Wed May 7 12:48:19 EDT 2008
Author: anthm
Date: Wed May 7 12:48:19 2008
New Revision: 8295
Modified:
freeswitch/trunk/src/mod/endpoints/mod_portaudio/pablio.c
Log:
change buffering in pa
Modified: freeswitch/trunk/src/mod/endpoints/mod_portaudio/pablio.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_portaudio/pablio.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_portaudio/pablio.c Wed May 7 12:48:19 2008
@@ -143,7 +143,7 @@
*/
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 @@
PaUtil_FlushRingBuffer(&aStream->inFIFO);
avail = 0;
}
-
- if (avail >= numBytes) {
+
+ if (avail >= numBytes * 2) {
bytesRead = PaUtil_ReadRingBuffer(&aStream->inFIFO, p, numBytes);
numBytes -= bytesRead;
readBytes += bytesRead;
More information about the Freeswitch-svn
mailing list