winepulse: Move pulse_get_buffer_size to unix lib.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Andrew Eikum <aeikum@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2021-05-19 22:24:02 +02:00 committed by Alexandre Julliard
parent 454712a94d
commit af84907cca
3 changed files with 19 additions and 8 deletions

View File

@ -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,

View File

@ -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,

View File

@ -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);