Module: wine Branch: master Commit: 959dd9a9a38aace40ad741afb46dc55eff562713 URL: https://gitlab.winehq.org/wine/wine/-/commit/959dd9a9a38aace40ad741afb46dc55...
Author: Davide Beatrici git@davidebeatrici.dev Date: Sat Jun 17 09:43:05 2023 +0200
winepulse: Move stream_release into mmdevapi.
---
dlls/mmdevapi/client.c | 12 ++++++++++++ dlls/winepulse.drv/mmdevdrv.c | 16 +++++----------- 2 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/dlls/mmdevapi/client.c b/dlls/mmdevapi/client.c index a0a2b225c0b..5d807776ff0 100644 --- a/dlls/mmdevapi/client.c +++ b/dlls/mmdevapi/client.c @@ -177,6 +177,18 @@ static DWORD CALLBACK timer_loop_func(void *user) 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, ¶ms); + + return params.result; +} + static BOOL query_productname(void *data, LANGANDCODEPAGE *lang, LPVOID *buffer, UINT *len) { WCHAR pn[37]; diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c index 6221856481d..4efc75dc5a5 100644 --- a/dlls/winepulse.drv/mmdevdrv.c +++ b/dlls/winepulse.drv/mmdevdrv.c @@ -133,6 +133,8 @@ extern HRESULT main_loop_start(void) DECLSPEC_HIDDEN; extern struct audio_session_wrapper *session_wrapper_create( struct audio_client *client) DECLSPEC_HIDDEN;
+extern HRESULT stream_release(stream_handle stream, HANDLE timer_thread); + extern WCHAR *get_application_name(void);
static inline ACImpl *impl_from_IAudioClient3(IAudioClient3 *iface) @@ -147,14 +149,6 @@ static void pulse_call(enum unix_funcs code, void *params) 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, ¶ms); -} - static void set_stream_volumes(ACImpl *This) { struct set_volumes_params params; @@ -444,7 +438,7 @@ static ULONG WINAPI AudioClient_Release(IAudioClient3 *iface) TRACE("(%p) Refcount now %lu\n", This, ref); if (!ref) { if (This->stream) { - pulse_release_stream(This->stream, This->timer_thread); + stream_release(This->stream, This->timer_thread); This->stream = 0; sessions_lock(); list_remove(&This->entry); @@ -639,7 +633,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface,
if (!(This->vols = malloc(channel_count * sizeof(*This->vols)))) { - pulse_release_stream(stream, NULL); + stream_release(stream, NULL); sessions_unlock(); return E_OUTOFMEMORY; } @@ -652,7 +646,7 @@ static HRESULT WINAPI AudioClient_Initialize(IAudioClient3 *iface, free(This->vols); This->vols = NULL; sessions_unlock(); - pulse_release_stream(stream, NULL); + stream_release(stream, NULL); return E_OUTOFMEMORY; }