change buffering in pa

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8295 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2008-05-07 16:48:19 +00:00
parent 885c4e54c8
commit a869f867d2
1 changed files with 3 additions and 3 deletions

View File

@ -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;