Commit af84907c authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

winepulse: Move pulse_get_buffer_size to unix lib.

parent 454712a9
......@@ -612,20 +612,15 @@ static HRESULT WINAPI AudioClient_GetBufferSize(IAudioClient3 *iface,
UINT32 *out)
{
ACImpl *This = impl_from_IAudioClient3(iface);
HRESULT hr;
TRACE("(%p)->(%p)\n", This, out);
if (!out)
return E_POINTER;
if (!This->pulse_stream)
return AUDCLNT_E_NOT_INITIALIZED;
pulse->lock();
hr = pulse_stream_valid(This);
if (SUCCEEDED(hr))
*out = This->pulse_stream->bufsize_frames;
pulse->unlock();
return hr;
return pulse->get_buffer_size(This->pulse_stream, out);
}
static HRESULT WINAPI AudioClient_GetStreamLatency(IAudioClient3 *iface,
......
......@@ -1532,6 +1532,20 @@ static HRESULT WINAPI pulse_release_render_buffer(struct pulse_stream *stream, U
return S_OK;
}
static HRESULT WINAPI pulse_get_buffer_size(struct pulse_stream *stream, UINT32 *out)
{
HRESULT hr = S_OK;
pulse_lock();
if (!pulse_stream_valid(stream))
hr = AUDCLNT_E_DEVICE_INVALIDATED;
else
*out = stream->bufsize_frames;
pulse_unlock();
return hr;
}
static void WINAPI pulse_set_volumes(struct pulse_stream *stream, float master_volume,
const float *volumes, const float *session_volumes)
{
......@@ -1573,6 +1587,7 @@ static const struct unix_funcs unix_funcs =
pulse_timer_loop,
pulse_get_render_buffer,
pulse_release_render_buffer,
pulse_get_buffer_size,
pulse_set_volumes,
pulse_set_event_handle,
pulse_test_connect,
......
......@@ -84,6 +84,7 @@ struct unix_funcs
HRESULT (WINAPI *get_render_buffer)(struct pulse_stream *stream, UINT32 frames, BYTE **data);
HRESULT (WINAPI *release_render_buffer)(struct pulse_stream *stream, UINT32 written_frames,
DWORD flags);
HRESULT (WINAPI *get_buffer_size)(struct pulse_stream *stream, UINT32 *out);
void (WINAPI *set_volumes)(struct pulse_stream *stream, float master_volume,
const float *volumes, const float *session_volumes);
HRESULT (WINAPI *set_event_handle)(struct pulse_stream *stream, HANDLE event);
......
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