Commit 08461970 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

winealsa: Move get_next_packet_size to the unixlib.

parent 03ad57d2
......@@ -2082,6 +2082,18 @@ static NTSTATUS get_current_padding(void *args)
return alsa_unlock_result(stream, &params->result, S_OK);
}
static NTSTATUS get_next_packet_size(void *args)
{
struct get_next_packet_size_params *params = args;
struct alsa_stream *stream = params->stream;
alsa_lock(stream);
*params->frames = stream->held_frames < stream->mmdev_period_frames ? 0 : stream->mmdev_period_frames;
return alsa_unlock_result(stream, &params->result, S_OK);
}
static NTSTATUS set_event_handle(void *args)
{
struct set_event_handle_params *params = args;
......@@ -2120,5 +2132,6 @@ unixlib_entry_t __wine_unix_call_funcs[] =
get_buffer_size,
get_latency,
get_current_padding,
get_next_packet_size,
set_event_handle,
};
......@@ -1414,20 +1414,19 @@ static HRESULT WINAPI AudioCaptureClient_GetNextPacketSize(
IAudioCaptureClient *iface, UINT32 *frames)
{
ACImpl *This = impl_from_IAudioCaptureClient(iface);
struct alsa_stream *stream = This->stream;
struct get_next_packet_size_params params;
TRACE("(%p)->(%p)\n", This, frames);
if(!frames)
return E_POINTER;
alsa_lock(stream);
*frames = stream->held_frames < stream->mmdev_period_frames ? 0 : stream->mmdev_period_frames;
params.stream = This->stream;
params.frames = frames;
alsa_unlock(stream);
ALSA_CALL(get_next_packet_size, &params);
return S_OK;
return params.result;
}
static const IAudioCaptureClientVtbl AudioCaptureClient_Vtbl =
......
......@@ -187,6 +187,13 @@ struct get_current_padding_params
UINT32 *padding;
};
struct get_next_packet_size_params
{
struct alsa_stream *stream;
HRESULT result;
UINT32 *frames;
};
struct set_event_handle_params
{
struct alsa_stream *stream;
......@@ -212,6 +219,7 @@ enum alsa_funcs
alsa_get_buffer_size,
alsa_get_latency,
alsa_get_current_padding,
alsa_get_next_packet_size,
alsa_set_event_handle,
};
......
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