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