Fill new software buffers with silence.

This commit is contained in:
Robert Reif 2005-02-09 14:05:00 +00:00 committed by Alexandre Julliard
parent e551555d4e
commit 098817950d
2 changed files with 3 additions and 1 deletions

View File

@ -1105,6 +1105,7 @@ HRESULT WINAPI IDirectSoundBufferImpl_Create(
return DSERR_OUTOFMEMORY;
}
dsb->buffer->ref = 1;
FillMemory(dsb->buffer->memory, dsb->buflen, dsbd->lpwfxFormat->wBitsPerSample == 8 ? 128 : 0);
}
/* Allocate the hardware buffer */
@ -1136,6 +1137,7 @@ HRESULT WINAPI IDirectSoundBufferImpl_Create(
return DSERR_OUTOFMEMORY;
}
dsb->buffer->ref = 1;
FillMemory(dsb->buffer->memory, dsb->buflen, dsbd->lpwfxFormat->wBitsPerSample == 8 ? 128 : 0);
}
err = DS_OK;
}

View File

@ -114,7 +114,7 @@ static HRESULT DSOUND_PrimaryOpen(IDirectSoundImpl *This)
This->pwqueue = 0;
This->playpos = 0;
This->mixpos = 0;
FillMemory(This->buffer, This->buflen, (This->pwfx->wBitsPerSample == 16) ? 0 : 128);
FillMemory(This->buffer, This->buflen, (This->pwfx->wBitsPerSample == 8) ? 128 : 0);
TRACE("fraglen=%ld\n", This->fraglen);
DSOUND_WaveQueue(This, (DWORD)-1);
}