Fill new software buffers with silence.
This commit is contained in:
parent
e551555d4e
commit
098817950d
|
@ -1105,6 +1105,7 @@ HRESULT WINAPI IDirectSoundBufferImpl_Create(
|
||||||
return DSERR_OUTOFMEMORY;
|
return DSERR_OUTOFMEMORY;
|
||||||
}
|
}
|
||||||
dsb->buffer->ref = 1;
|
dsb->buffer->ref = 1;
|
||||||
|
FillMemory(dsb->buffer->memory, dsb->buflen, dsbd->lpwfxFormat->wBitsPerSample == 8 ? 128 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Allocate the hardware buffer */
|
/* Allocate the hardware buffer */
|
||||||
|
@ -1136,6 +1137,7 @@ HRESULT WINAPI IDirectSoundBufferImpl_Create(
|
||||||
return DSERR_OUTOFMEMORY;
|
return DSERR_OUTOFMEMORY;
|
||||||
}
|
}
|
||||||
dsb->buffer->ref = 1;
|
dsb->buffer->ref = 1;
|
||||||
|
FillMemory(dsb->buffer->memory, dsb->buflen, dsbd->lpwfxFormat->wBitsPerSample == 8 ? 128 : 0);
|
||||||
}
|
}
|
||||||
err = DS_OK;
|
err = DS_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,7 +114,7 @@ static HRESULT DSOUND_PrimaryOpen(IDirectSoundImpl *This)
|
||||||
This->pwqueue = 0;
|
This->pwqueue = 0;
|
||||||
This->playpos = 0;
|
This->playpos = 0;
|
||||||
This->mixpos = 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);
|
TRACE("fraglen=%ld\n", This->fraglen);
|
||||||
DSOUND_WaveQueue(This, (DWORD)-1);
|
DSOUND_WaveQueue(This, (DWORD)-1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue