Claire Girka : winepulse: Store and use device period on stream creation.
Alexandre Julliard
julliard at winehq.org
Wed Jul 6 16:55:53 CDT 2022
Module: wine
Branch: master
Commit: b4aa68c9c711a7b6572fbe7cdf6d7cd7fb9303b9
URL: https://source.winehq.org/git/wine.git/?a=commit;h=b4aa68c9c711a7b6572fbe7cdf6d7cd7fb9303b9
Author: Claire Girka <claire at sitedethib.com>
Date: Mon Jul 4 21:37:00 2022 +0200
winepulse: Store and use device period on stream creation.
---
dlls/winepulse.drv/pulse.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/dlls/winepulse.drv/pulse.c b/dlls/winepulse.drv/pulse.c
index 40f5f66c129..caf9a1c9c51 100644
--- a/dlls/winepulse.drv/pulse.c
+++ b/dlls/winepulse.drv/pulse.c
@@ -57,6 +57,8 @@ struct pulse_stream
HANDLE event;
float vol[PA_CHANNELS_MAX];
+ REFERENCE_TIME def_period;
+
INT32 locked;
BOOL started;
SIZE_T bufsize_frames, real_bufsize_bytes, period_bytes;
@@ -1123,10 +1125,16 @@ static NTSTATUS pulse_create_stream(void *args)
if (FAILED(hr))
goto exit;
- period = pulse_def_period[stream->dataflow == eCapture];
+ period = 0;
+ hr = get_device_period_helper(params->dataflow, params->pulse_name, &period, NULL);
+ if (FAILED(hr))
+ goto exit;
+
if (duration < 3 * period)
duration = 3 * period;
+ stream->def_period = period;
+
stream->period_bytes = pa_frame_size(&stream->ss) * muldiv(period, stream->ss.rate, 10000000);
stream->bufsize_frames = ceil((duration / 10000000.) * params->fmt->nSamplesPerSec);
More information about the wine-cvs
mailing list