dsound SRC bug fix

Robert Reif reif at earthlink.net
Tue Aug 10 17:44:15 CDT 2004


This fixes a bug in this patch.

Robert Reif wrote:

> Fixes a bug where freqAdjust was not being updated properly
> when the primary buffer format changed.
>
> This should fix some of the complaints about sound playing at the 
> wrong speed.
>
>  
>

-------------- next part --------------
Index: dlls/dsound/primary.c
===================================================================
RCS file: /home/wine/wine/dlls/dsound/primary.c,v
retrieving revision 1.27
diff -u -r1.27 primary.c
--- dlls/dsound/primary.c	9 Aug 2004 22:56:45 -0000	1.27
+++ dlls/dsound/primary.c	10 Aug 2004 22:41:33 -0000
@@ -340,7 +340,8 @@
 	ICOM_THIS(PrimaryBufferImpl,iface);
 	IDirectSoundImpl* dsound = This->dsound;
 	HRESULT err = DS_OK;
-	int			i;
+	int i;
+	DWORD nSamplesPerSec; 
 	TRACE("(%p,%p)\n",This,wfex);
 
 	if (This->dsound->priolevel == DSSCL_NORMAL) {
@@ -370,6 +371,7 @@
 	/* **** */
 	RtlAcquireResourceExclusive(&(dsound->lock), TRUE);
 
+	nSamplesPerSec = dsound->wfx.nSamplesPerSec;
 	dsound->wfx.nSamplesPerSec = wfex->nSamplesPerSec;
 	dsound->wfx.nChannels = wfex->nChannels;
 	dsound->wfx.wBitsPerSample = wfex->wBitsPerSample;
@@ -425,7 +427,7 @@
 	}
 	DSOUND_RecalcPrimary(dsound);
 
-	if (dsound->wfx.nSamplesPerSec != wfex->nSamplesPerSec) {
+	if (nSamplesPerSec != dsound->wfx.nSamplesPerSec) {
 		IDirectSoundBufferImpl** dsb = dsound->buffers;
 		for (i = 0; i < dsound->nrofbuffers; i++, dsb++) {
 			/* **** */


More information about the wine-patches mailing list