Module: wine Branch: master Commit: 57dfaf1d0cb60cf6c930440ac96b84f45cda28da URL: https://gitlab.winehq.org/wine/wine/-/commit/57dfaf1d0cb60cf6c930440ac96b84f...
Author: Davide Beatrici git@davidebeatrici.dev Date: Sat Apr 8 04:32:42 2023 +0200
winecoreaudio: Retain precision when storing period in unixlib.
---
dlls/winecoreaudio.drv/coreaudio.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/winecoreaudio.drv/coreaudio.c b/dlls/winecoreaudio.drv/coreaudio.c index 073dacf4bad..e651eee5d3a 100644 --- a/dlls/winecoreaudio.drv/coreaudio.c +++ b/dlls/winecoreaudio.drv/coreaudio.c @@ -85,7 +85,8 @@ struct coreaudio_stream AUDCLNT_SHAREMODE share;
BOOL playing; - UINT32 period_ms, period_frames; + REFERENCE_TIME period; + UINT32 period_frames; UINT32 bufsize_frames, resamp_bufsize_frames; UINT32 lcl_offs_frames, held_frames, wri_offs_frames, tmp_buffer_frames; UINT32 cap_bufsize_frames, cap_offs_frames, cap_held_frames; @@ -658,7 +659,7 @@ static NTSTATUS unix_create_stream(void *args) goto end; }
- stream->period_ms = params->period / 10000; + stream->period = params->period; stream->period_frames = muldiv(params->period, stream->fmt->nSamplesPerSec, 10000000); stream->dev_id = dev_id_from_device(params->device); stream->flow = params->flow; @@ -1272,8 +1273,7 @@ static NTSTATUS unix_get_latency(void *args) latency += stream_latency; /* pretend we process audio in Period chunks, so max latency includes * the period time */ - *params->latency = muldiv(latency, 10000000, stream->fmt->nSamplesPerSec) - + stream->period_ms * 10000; + *params->latency = muldiv(latency, 10000000, stream->fmt->nSamplesPerSec) + stream->period;
OSSpinLockUnlock(&stream->lock); params->result = S_OK;