From 79df4b2499ab2384bf92132c03563cf88bf623b2 Mon Sep 17 00:00:00 2001 From: reimar Date: Fri, 6 Mar 2009 16:27:31 +0000 Subject: [PATCH] Use calloc instead of malloc+memset git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28852 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libao2/ao_win32.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libao2/ao_win32.c b/libao2/ao_win32.c index f3e0df1ce1..29ecfef23c 100644 --- a/libao2/ao_win32.c +++ b/libao2/ao_win32.c @@ -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,int format,int flags) 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; -- 2.11.4.GIT