Commit 6d238163 authored by Jörg Höhle's avatar Jörg Höhle Committed by Alexandre Julliard

wineoss: GetStreamLatency is constant, SNDCTL_DSP_GETODELAY is dynamic.

parent 92d8e93a
...@@ -1046,26 +1046,9 @@ static HRESULT WINAPI AudioClient_GetStreamLatency(IAudioClient *iface, ...@@ -1046,26 +1046,9 @@ static HRESULT WINAPI AudioClient_GetStreamLatency(IAudioClient *iface,
return AUDCLNT_E_NOT_INITIALIZED; 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 /* pretend we process audio in Period chunks, so max latency includes
* the period time */ * the period time. Some native machines add .6666ms in shared mode. */
*latency += DefaultPeriod; *latency = This->period_us * 10 + 6666;
LeaveCriticalSection(&This->lock); LeaveCriticalSection(&This->lock);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment