From cb4889d940a40fc4a6fbac5a80c4468b0b7bcb29 Mon Sep 17 00:00:00 2001 From: Sagar Mittal Date: Fri, 18 Aug 2006 12:38:38 -0400 Subject: [PATCH] quartz: DSoundRender: Do not overwrite a full buffer. --- dlls/quartz/dsoundrender.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dlls/quartz/dsoundrender.c b/dlls/quartz/dsoundrender.c index c095f7ee7cd..dfc285f339e 100644 --- a/dlls/quartz/dsoundrender.c +++ b/dlls/quartz/dsoundrender.c @@ -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) {