=?UTF-8?Q?J=C3=B6rg=20H=C3=B6hle=20?=: wineoss: GetStreamLatency is constant, SNDCTL_DSP_GETODELAY is dynamic.
Alexandre Julliard
julliard at winehq.org
Fri Jan 6 15:31:34 CST 2012
Module: wine
Branch: master
Commit: 6d23816300a79e12ce927ebc14948831826038ea
URL: http://source.winehq.org/git/wine.git/?a=commit;h=6d23816300a79e12ce927ebc14948831826038ea
Author: Jörg Höhle <hoehle at users.sourceforge.net>
Date: Thu Jan 5 22:19:35 2012 +0100
wineoss: GetStreamLatency is constant, SNDCTL_DSP_GETODELAY is dynamic.
---
dlls/wineoss.drv/mmdevdrv.c | 21 ++-------------------
1 files changed, 2 insertions(+), 19 deletions(-)
diff --git a/dlls/wineoss.drv/mmdevdrv.c b/dlls/wineoss.drv/mmdevdrv.c
index 304a5e1..15bda6a 100644
--- a/dlls/wineoss.drv/mmdevdrv.c
+++ b/dlls/wineoss.drv/mmdevdrv.c
@@ -1046,26 +1046,9 @@ static HRESULT WINAPI AudioClient_GetStreamLatency(IAudioClient *iface,
return AUDCLNT_E_NOT_INITIALIZED;
}
- if(This->dataflow == eRender){
- int delay_bytes;
- double delay_s;
-
- if(ioctl(This->fd, SNDCTL_DSP_GETODELAY, &delay_bytes) < 0){
- LeaveCriticalSection(&This->lock);
- WARN("GETODELAY failed: %d (%s)\n", errno, strerror(errno));
- return E_FAIL;
- }
-
- delay_s = delay_bytes / (double)(This->fmt->nSamplesPerSec *
- This->fmt->nBlockAlign);
-
- *latency = delay_s * 10000000;
- }else
- *latency = 10000; /* OSS doesn't provide input latency */
-
/* pretend we process audio in Period chunks, so max latency includes
- * the period time */
- *latency += DefaultPeriod;
+ * the period time. Some native machines add .6666ms in shared mode. */
+ *latency = This->period_us * 10 + 6666;
LeaveCriticalSection(&This->lock);
More information about the wine-cvs
mailing list