dsound: Merge two identical allocation blocks.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
oldstable
Huw Davies 2017-02-26 17:42:22 +00:00 committed by Alexandre Julliard
parent 3076192e7d
commit b47487af99
1 changed files with 3 additions and 13 deletions

View File

@ -238,19 +238,9 @@ static HRESULT DSOUND_PrimaryOpen(DirectSoundDevice *device, WAVEFORMATEX *wfx,
mixfloat = TRUE;
/* reallocate emulated primary buffer */
if (forcewave) {
if (device->buffer)
newbuf = HeapReAlloc(GetProcessHeap(), 0, device->buffer, new_buflen);
else
newbuf = HeapAlloc(GetProcessHeap(), 0, new_buflen);
if (!newbuf) {
ERR("failed to allocate primary buffer\n");
return DSERR_OUTOFMEMORY;
}
FillMemory(newbuf, new_buflen, (wfx->wBitsPerSample == 8) ? 128 : 0);
} else if (!mixfloat) {
new_buflen = frames * sizeof(float);
if (forcewave || !mixfloat) {
if (!forcewave)
new_buflen = frames * sizeof(float);
if (device->buffer)
newbuf = HeapReAlloc(GetProcessHeap(), 0, device->buffer, new_buflen);