diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-03-06 16:27:31 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-03-06 16:27:31 +0000 |
commit | 79df4b2499ab2384bf92132c03563cf88bf623b2 (patch) | |
tree | 766f95a67ad25b9d4c11caabe209e551f0e877a9 | |
parent | 1b1bc049dba88de156cdc9c92cb85129e3b793f3 (diff) |
Use calloc instead of malloc+memset
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28852 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | libao2/ao_win32.c | 4 |
1 files changed, 1 insertions, 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; |