[MPlayer-cvslog] r28852 - trunk/libao2/ao_win32.c

reimar subversion at mplayerhq.hu
Fri Mar 6 17:27:32 CET 2009


Author: reimar
Date: Fri Mar  6 17:27:31 2009
New Revision: 28852

Log:
Use calloc instead of malloc+memset

Modified:
   trunk/libao2/ao_win32.c

Modified: trunk/libao2/ao_win32.c
==============================================================================
--- trunk/libao2/ao_win32.c	Fri Mar  6 16:52:48 2009	(r28851)
+++ trunk/libao2/ao_win32.c	Fri Mar  6 17:27:31 2009	(r28852)
@@ -146,7 +146,6 @@ static int control(int cmd,void *arg)
 static int init(int rate,int channels,int format,int flags)
 {
 	WAVEFORMATEXTENSIBLE wformat;      
-	DWORD totalBufferSize = (BUFFER_SIZE + sizeof(WAVEHDR)) * BUFFER_COUNT;
 	MMRESULT result;
 	unsigned char* buffer;
 	int i;
@@ -231,8 +230,7 @@ static int init(int rate,int channels,in
 		return 0;
     }
 	//allocate buffer memory as one big block
-	buffer = malloc(totalBufferSize);
-	memset(buffer,0x0,totalBufferSize);
+	buffer = calloc(BUFFER_COUNT, BUFFER_SIZE + sizeof(WAVEHDR));
     //and setup pointers to each buffer 
     waveBlocks = (WAVEHDR*)buffer;
     buffer += sizeof(WAVEHDR) * BUFFER_COUNT;



More information about the MPlayer-cvslog mailing list