quartz: DSoundRender: Do not overwrite a full buffer.

This commit is contained in:
Sagar Mittal 2006-08-18 12:38:38 -04:00 committed by Alexandre Julliard
parent 5c07d88ed1
commit cb4889d940
1 changed files with 7 additions and 0 deletions

View File

@ -179,6 +179,13 @@ static HRESULT DSoundRender_SendSampleData(DSoundRenderImpl* This, LPBYTE data,
else
buf_free = DSBUFFERSIZE - This->write_pos + play_pos;
/* This situation is ambiguous; Assume full when playing */
if(buf_free == DSBUFFERSIZE && This->started)
{
Sleep(10);
continue;
}
size2 = min(buf_free, size);
hr = IDirectSoundBuffer_Lock(This->dsbuffer, This->write_pos, size2, &lpbuf1, &dwsize1, &lpbuf2, &dwsize2, 0);
if (hr != DS_OK) {