Browse Source

Set audio buffer size to 2s

Lou Yihua 7 years ago
parent
commit
8055ce9b3c
1 changed files with 2 additions and 2 deletions
  1. 2 2
      aviplay.c

+ 2 - 2
aviplay.c

@@ -288,9 +288,9 @@ PAL_ReadAVIInfo(
 			else
 				avi->pChunkBuffer = NULL;
 			//
-			// Allocate audio buffer, the buffer size is at least one second long in destination format
+			// Allocate audio buffer, the buffer size is large enough to hold two-second audio data
 			//
-			avi->dwAudBufLen = max(wfe.format.nAvgBytesPerSec, aviHeader.dwSuggestedBufferSize) * avi->cvt.len_mult;
+			avi->dwAudBufLen = max(wfe.format.nAvgBytesPerSec * 2, aviHeader.dwSuggestedBufferSize) * avi->cvt.len_mult;
 			avi->pbAudioBuf = (uint8_t *)UTIL_malloc(avi->dwAudBufLen);
 			avi->dwAudioReadPos = avi->dwAudioWritePos = 0;
 			return avi;