DSOUND fill new buffers with silence

Robert Reif reif at earthlink.net
Wed Feb 9 06:25:24 CST 2005


Fill new software buffers with silence.
-------------- next part --------------
Index: dlls/dsound/buffer.c
===================================================================
RCS file: /home/wine/wine/dlls/dsound/buffer.c,v
retrieving revision 1.43
diff -u -p -r1.43 buffer.c
--- dlls/dsound/buffer.c	24 Jan 2005 13:31:27 -0000	1.43
+++ dlls/dsound/buffer.c	9 Feb 2005 12:15:07 -0000
@@ -1105,6 +1105,7 @@ HRESULT WINAPI IDirectSoundBufferImpl_Cr
 			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_Cr
 					return DSERR_OUTOFMEMORY;
 				}
 				dsb->buffer->ref = 1;
+				FillMemory(dsb->buffer->memory, dsb->buflen, dsbd->lpwfxFormat->wBitsPerSample == 8 ? 128 : 0);
 			}
 			err = DS_OK;
 		}
Index: dlls/dsound/primary.c
===================================================================
RCS file: /home/wine/wine/dlls/dsound/primary.c,v
retrieving revision 1.40
diff -u -p -r1.40 primary.c
--- dlls/dsound/primary.c	24 Jan 2005 13:35:57 -0000	1.40
+++ dlls/dsound/primary.c	9 Feb 2005 12:15:08 -0000
@@ -114,7 +114,7 @@ static HRESULT DSOUND_PrimaryOpen(IDirec
 			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);
 		}


More information about the wine-patches mailing list