Commit 959dd9a9 authored by Davide Beatrici's avatar Davide Beatrici Committed by Alexandre Julliard

winepulse: Move stream_release into mmdevapi.

parent add5c43f
...@@ -177,6 +177,18 @@ static DWORD CALLBACK timer_loop_func(void *user) ...@@ -177,6 +177,18 @@ static DWORD CALLBACK timer_loop_func(void *user)
return 0; return 0;
} }
HRESULT stream_release(stream_handle stream, HANDLE timer_thread)
{
struct release_stream_params params;
params.stream = stream;
params.timer_thread = timer_thread;
WINE_UNIX_CALL(release_stream, &params);
return params.result;
}
static BOOL query_productname(void *data, LANGANDCODEPAGE *lang, LPVOID *buffer, UINT *len) static BOOL query_productname(void *data, LANGANDCODEPAGE *lang, LPVOID *buffer, UINT *len)
{ {
WCHAR pn[37]; WCHAR pn[37];
......
...@@ -133,6 +133,8 @@ extern HRESULT main_loop_start(void) DECLSPEC_HIDDEN; ...@@ -133,6 +133,8 @@ extern HRESULT main_loop_start(void) DECLSPEC_HIDDEN;
extern struct audio_session_wrapper *session_wrapper_create( extern struct audio_session_wrapper *session_wrapper_create(
struct audio_client *client) DECLSPEC_HIDDEN; struct audio_client *client) DECLSPEC_HIDDEN;
extern HRESULT stream_release(stream_handle stream, HANDLE timer_thread);
extern WCHAR *get_application_name(void); extern WCHAR *get_application_name(void);
static inline ACImpl *impl_from_IAudioClient3(IAudioClient3 *iface) static inline ACImpl *impl_from_IAudioClient3(IAudioClient3 *iface)
...@@ -147,14 +149,6 @@ static void pulse_call(enum unix_funcs code, void *params) ...@@ -147,14 +149,6 @@ static void pulse_call(enum unix_funcs code, void *params)
assert(!status); assert(!status);
} }
static void pulse_release_stream(stream_handle stream, HANDLE timer)
{
struct release_stream_params params;
params.stream = stream;
params.timer_thread = timer;
pulse_call(release_stream, &params);
}
static void set_stream_volumes(ACImpl *This) static void set_stream_volumes(ACImpl *This)
{ {
struct set_volumes_params params; struct set_volumes_params params;
...@@ -444,7 +438,7 @@ static ULONG WINAPI AudioClient_Release(IAudioClient3 *iface) ...@@ -444,7 +438,7 @@ static ULONG WINAPI AudioClient_Release(IAudioClient3 *iface)
TRACE("(%p) Refcount now %lu\n", This, ref); TRACE("(%p) Refcount now %lu\n", This, ref);
if (!ref) { if (!ref) {
if (This->stream) { if (This->stream) {
pulse_release_stream(This->stream, This->timer_thread); stream_release(This->stream, This->timer_thread);
This->stream = 0; This->stream = 0;
sessions_lock(); sessions_lock();
list_remove(&This->entry); list_remove(&This->entry);
...@@ -639,7 +633,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface, ...@@ -639,7 +633,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface,
if (!(This->vols = malloc(channel_count * sizeof(*This->vols)))) if (!(This->vols = malloc(channel_count * sizeof(*This->vols))))
{ {
pulse_release_stream(stream, NULL); stream_release(stream, NULL);
sessions_unlock(); sessions_unlock();
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
...@@ -652,7 +646,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface, ...@@ -652,7 +646,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface,
free(This->vols); free(This->vols);
This->vols = NULL; This->vols = NULL;
sessions_unlock(); sessions_unlock();
pulse_release_stream(stream, NULL); stream_release(stream, NULL);
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
......
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