Commit b47487af authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

dsound: Merge two identical allocation blocks.

parent 3076192e
......@@ -238,18 +238,8 @@ 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) {
if (forcewave || !mixfloat) {
if (!forcewave)
new_buflen = frames * sizeof(float);
if (device->buffer)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment