wineoss: Move get_current_padding to the unixlib.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Huw Davies 2022-04-13 07:38:46 +01:00 committed by Alexandre Julliard
parent 984cae317b
commit cdd19e3d1c
3 changed files with 26 additions and 8 deletions

View File

@ -827,7 +827,7 @@ static HRESULT WINAPI AudioClient_GetCurrentPadding(IAudioClient3 *iface,
UINT32 *numpad)
{
ACImpl *This = impl_from_IAudioClient3(iface);
struct oss_stream *stream = This->stream;
struct get_current_padding_params params;
TRACE("(%p)->(%p)\n", This, numpad);
@ -837,15 +837,12 @@ static HRESULT WINAPI AudioClient_GetCurrentPadding(IAudioClient3 *iface,
if(!This->stream)
return AUDCLNT_E_NOT_INITIALIZED;
oss_lock(stream);
*numpad = stream->held_frames;
params.stream = This->stream;
params.padding = numpad;
OSS_CALL(get_current_padding, &params);
TRACE("padding: %u\n", *numpad);
oss_unlock(stream);
return S_OK;
return params.result;
}
static HRESULT WINAPI AudioClient_IsFormatSupported(IAudioClient3 *iface,

View File

@ -776,6 +776,18 @@ static NTSTATUS get_latency(void *args)
return oss_unlock_result(stream, &params->result, S_OK);
}
static NTSTATUS get_current_padding(void *args)
{
struct get_current_padding_params *params = args;
struct oss_stream *stream = params->stream;
oss_lock(stream);
*params->padding = stream->held_frames;
return oss_unlock_result(stream, &params->result, S_OK);
}
unixlib_entry_t __wine_unix_call_funcs[] =
{
test_connect,
@ -786,4 +798,5 @@ unixlib_entry_t __wine_unix_call_funcs[] =
get_mix_format,
get_buffer_size,
get_latency,
get_current_padding,
};

View File

@ -120,6 +120,13 @@ struct get_latency_params
REFERENCE_TIME *latency;
};
struct get_current_padding_params
{
struct oss_stream *stream;
HRESULT result;
UINT32 *padding;
};
enum oss_funcs
{
oss_test_connect,
@ -130,6 +137,7 @@ enum oss_funcs
oss_get_mix_format,
oss_get_buffer_size,
oss_get_latency,
oss_get_current_padding,
};
extern unixlib_handle_t oss_handle;