Huw Davies : wineoss: Store the period in 100ns units.
Alexandre Julliard
julliard at winehq.org
Thu Apr 14 16:50:33 CDT 2022
Module: wine
Branch: master
Commit: ebfd2e84954e4da13f9c48fad1e229bef7677e6b
URL: https://source.winehq.org/git/wine.git/?a=commit;h=ebfd2e84954e4da13f9c48fad1e229bef7677e6b
Author: Huw Davies <huw at codeweavers.com>
Date: Wed Apr 13 07:38:47 2022 +0100
wineoss: Store the period in 100ns units.
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wineoss.drv/mmdevdrv.c | 2 +-
dlls/wineoss.drv/oss.c | 4 ++--
dlls/wineoss.drv/unixlib.h | 3 ++-
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/dlls/wineoss.drv/mmdevdrv.c b/dlls/wineoss.drv/mmdevdrv.c
index fb71aa7562a..e61c3c95df2 100644
--- a/dlls/wineoss.drv/mmdevdrv.c
+++ b/dlls/wineoss.drv/mmdevdrv.c
@@ -1120,7 +1120,7 @@ static HRESULT WINAPI AudioClient_Start(IAudioClient3 *iface)
if(!This->timer){
if(!CreateTimerQueueTimer(&This->timer, g_timer_q,
- oss_period_callback, This, 0, stream->period_us / 1000,
+ oss_period_callback, This, 0, stream->period / 10000,
WT_EXECUTEINTIMERTHREAD))
ERR("Unable to create period timer: %u\n", GetLastError());
}
diff --git a/dlls/wineoss.drv/oss.c b/dlls/wineoss.drv/oss.c
index 7e716ef4704..b00925d6e9b 100644
--- a/dlls/wineoss.drv/oss.c
+++ b/dlls/wineoss.drv/oss.c
@@ -564,7 +564,7 @@ static NTSTATUS create_stream(void *args)
}
stream->fmt = &fmtex->Format;
- stream->period_us = params->period / 10;
+ stream->period = params->period;
stream->period_frames = muldiv(params->fmt->nSamplesPerSec, params->period, 10000000);
stream->bufsize_frames = muldiv(params->duration, params->fmt->nSamplesPerSec, 10000000);
@@ -771,7 +771,7 @@ static NTSTATUS get_latency(void *args)
/* pretend we process audio in Period chunks, so max latency includes
* the period time. Some native machines add .6666ms in shared mode. */
- *params->latency = (REFERENCE_TIME)stream->period_us * 10 + 6666;
+ *params->latency = stream->period + 6666;
return oss_unlock_result(stream, ¶ms->result, S_OK);
}
diff --git a/dlls/wineoss.drv/unixlib.h b/dlls/wineoss.drv/unixlib.h
index bc88be80db2..64c954cc769 100644
--- a/dlls/wineoss.drv/unixlib.h
+++ b/dlls/wineoss.drv/unixlib.h
@@ -30,8 +30,9 @@ struct oss_stream
BOOL playing, mute;
UINT64 written_frames, last_pos_frames;
- UINT32 period_us, period_frames, bufsize_frames, held_frames, tmp_buffer_frames, in_oss_frames;
+ UINT32 period_frames, bufsize_frames, held_frames, tmp_buffer_frames, in_oss_frames;
UINT32 oss_bufsize_bytes, lcl_offs_frames; /* offs into local_buffer where valid data starts */
+ REFERENCE_TIME period;
BYTE *local_buffer, *tmp_buffer;
INT32 getbuf_last; /* <0 when using tmp_buffer */
More information about the wine-cvs
mailing list