From: Claire Girka <claire(a)sitedethib.com> --- dlls/winepulse.drv/pulse.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/dlls/winepulse.drv/pulse.c b/dlls/winepulse.drv/pulse.c index 6b6e4f4453c..351025b430a 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; @@ -1122,10 +1124,18 @@ static NTSTATUS pulse_create_stream(void *args) if (FAILED(hr)) goto exit; - period = pulse_def_period[stream->dataflow == eCapture]; + period = 0; + if (FAILED(get_device_period_helper(params->dataflow, params->pulse_name, &period, NULL))) { + pulse_unlock(); + params->result = E_FAIL; + return STATUS_SUCCESS; + } + 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); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/337