Maarten Lankhorst : dsound/winealsa: Remove writelead for alsa directsound.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Jun 28 08:08:09 CDT 2007


Module: wine
Branch: master
Commit: f4d5f127dda38bc4db46f0a904645d1c82150b39
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f4d5f127dda38bc4db46f0a904645d1c82150b39

Author: Maarten Lankhorst <m.b.lankhorst at gmail.com>
Date:   Sat Jun 23 20:40:35 2007 +0200

dsound/winealsa: Remove writelead for alsa directsound.

---

 dlls/dsound/primary.c        |    5 ++++-
 dlls/winealsa.drv/dsoutput.c |    2 +-
 include/dsdriver.h           |    1 +
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/dlls/dsound/primary.c b/dlls/dsound/primary.c
index 39c097a..d8d7dc6 100644
--- a/dlls/dsound/primary.c
+++ b/dlls/dsound/primary.c
@@ -64,8 +64,11 @@ static void DSOUND_RecalcPrimary(DirectSoundDevice *device)
 		device->fraglen = fraglen;
 		TRACE("fraglen=%d\n", device->fraglen);
 	}
+	if (device->hwbuf && device->drvdesc.dwFlags & DSDDESC_DONTNEEDWRITELEAD)
+		device->writelead = 0;
+	else
 	/* calculate the 10ms write lead */
-	device->writelead = (device->pwfx->nSamplesPerSec / 100) * nBlockAlign;
+		device->writelead = (device->pwfx->nSamplesPerSec / 100) * nBlockAlign;
 }
 
 static HRESULT DSOUND_PrimaryOpen(DirectSoundDevice *device)
diff --git a/dlls/winealsa.drv/dsoutput.c b/dlls/winealsa.drv/dsoutput.c
index 2e8d1f3..2879d2e 100644
--- a/dlls/winealsa.drv/dsoutput.c
+++ b/dlls/winealsa.drv/dsoutput.c
@@ -596,7 +596,7 @@ static HRESULT WINAPI IDsDriverImpl_GetDriverDesc(PIDSDRIVER iface, PDSDRIVERDES
     IDsDriverImpl *This = (IDsDriverImpl *)iface;
     TRACE("(%p,%p)\n",iface,pDesc);
     memcpy(pDesc, &(WOutDev[This->wDevID].ds_desc), sizeof(DSDRIVERDESC));
-    pDesc->dwFlags		= DSDDESC_DONTNEEDPRIMARYLOCK | DSDDESC_DONTNEEDSECONDARYLOCK;
+    pDesc->dwFlags		= DSDDESC_DONTNEEDPRIMARYLOCK | DSDDESC_DONTNEEDSECONDARYLOCK | DSDDESC_DONTNEEDWRITELEAD;
     pDesc->dnDevNode		= WOutDev[This->wDevID].waveDesc.dnDevNode;
     pDesc->wVxdId		= 0;
     pDesc->wReserved		= 0;
diff --git a/include/dsdriver.h b/include/dsdriver.h
index db48167..bb7f4c6 100644
--- a/include/dsdriver.h
+++ b/include/dsdriver.h
@@ -52,6 +52,7 @@ typedef struct IDsCaptureDriverBuffer *PIDSCDRIVERBUFFER;
 #define DSDDESC_USESYSTEMMEMORY		0x00000004
 #define DSDDESC_DONTNEEDPRIMARYLOCK	0x00000008
 #define DSDDESC_DONTNEEDSECONDARYLOCK	0x00000010
+#define DSDDESC_DONTNEEDWRITELEAD	0x00000020
 
 #define DSDHEAP_NOHEAP			0
 #define DSDHEAP_CREATEHEAP		1




More information about the wine-cvs mailing list