Commit 1adee1bc authored by Davide Beatrici's avatar Davide Beatrici Committed by Alexandre Julliard

winealsa: Implement get_device_period in unixlib.

parent 64cdecc6
......@@ -82,7 +82,9 @@ struct alsa_stream
pthread_mutex_t lock;
};
#define EXTRA_SAFE_RT 40000
#define EXTRA_SAFE_RT 40000
static const REFERENCE_TIME def_period = 100000;
static const WCHAR drv_keyW[] = {'S','o','f','t','w','a','r','e','\\',
'W','i','n','e','\\','D','r','i','v','e','r','s','\\',
......@@ -2096,6 +2098,20 @@ exit:
return STATUS_SUCCESS;
}
static NTSTATUS alsa_get_device_period(void *args)
{
struct get_device_period_params *params = args;
if (params->def_period)
*params->def_period = def_period;
if (params->min_period)
*params->min_period = def_period;
params->result = S_OK;
return STATUS_SUCCESS;
}
static NTSTATUS alsa_get_buffer_size(void *args)
{
struct get_buffer_size_params *params = args;
......@@ -2458,7 +2474,7 @@ unixlib_entry_t __wine_unix_call_funcs[] =
alsa_release_capture_buffer,
alsa_is_format_supported,
alsa_get_mix_format,
alsa_not_implemented,
alsa_get_device_period,
alsa_get_buffer_size,
alsa_get_latency,
alsa_get_current_padding,
......@@ -2653,6 +2669,28 @@ static NTSTATUS alsa_wow64_get_mix_format(void *args)
return STATUS_SUCCESS;
}
static NTSTATUS alsa_wow64_get_device_period(void *args)
{
struct
{
PTR32 device;
EDataFlow flow;
HRESULT result;
PTR32 def_period;
PTR32 min_period;
} *params32 = args;
struct get_device_period_params params =
{
.device = ULongToPtr(params32->device),
.flow = params32->flow,
.def_period = ULongToPtr(params32->def_period),
.min_period = ULongToPtr(params32->min_period),
};
alsa_get_device_period(&params);
params32->result = params.result;
return STATUS_SUCCESS;
}
static NTSTATUS alsa_wow64_get_buffer_size(void *args)
{
struct
......@@ -2877,7 +2915,7 @@ unixlib_entry_t __wine_unix_call_wow64_funcs[] =
alsa_release_capture_buffer,
alsa_wow64_is_format_supported,
alsa_wow64_get_mix_format,
alsa_not_implemented,
alsa_wow64_get_device_period,
alsa_wow64_get_buffer_size,
alsa_wow64_get_latency,
alsa_wow64_get_current_padding,
......
......@@ -824,18 +824,21 @@ static HRESULT WINAPI AudioClient_GetDevicePeriod(IAudioClient3 *iface,
REFERENCE_TIME *defperiod, REFERENCE_TIME *minperiod)
{
ACImpl *This = impl_from_IAudioClient3(iface);
struct get_device_period_params params;
TRACE("(%p)->(%p, %p)\n", This, defperiod, minperiod);
if(!defperiod && !minperiod)
if (!defperiod && !minperiod)
return E_POINTER;
if(defperiod)
*defperiod = DefaultPeriod;
if(minperiod)
*minperiod = DefaultPeriod;
params.device = This->device_name;
params.flow = This->dataflow;
params.def_period = defperiod;
params.min_period = minperiod;
return S_OK;
ALSA_CALL(get_device_period, &params);
return params.result;
}
static HRESULT WINAPI AudioClient_Start(IAudioClient3 *iface)
......
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