From 70958b46d08260f4eac7bce5f3042f12c731e8b9 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Tue, 7 Mar 2023 11:24:26 +1100 Subject: [PATCH] Rebase against 45e83cc8c28cece236f1537958f6e21b48193f2c. --- ...e-a-separate-mainloop-and-ctx-for-pu.patch | 35 ++++++++++--------- staging/upstream-commit | 2 +- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/patches/winepulse-PulseAudio_Support/0001-winepulse.drv-Use-a-separate-mainloop-and-ctx-for-pu.patch b/patches/winepulse-PulseAudio_Support/0001-winepulse.drv-Use-a-separate-mainloop-and-ctx-for-pu.patch index 5b800eb8..d5b2d956 100644 --- a/patches/winepulse-PulseAudio_Support/0001-winepulse.drv-Use-a-separate-mainloop-and-ctx-for-pu.patch +++ b/patches/winepulse-PulseAudio_Support/0001-winepulse.drv-Use-a-separate-mainloop-and-ctx-for-pu.patch @@ -1,18 +1,18 @@ -From 2700c7d5ef1b90ecb2140736e8380c07a1decd13 Mon Sep 17 00:00:00 2001 +From bc89b07a911b8af2a171b26defec4794fc408881 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Wed, 4 Nov 2015 02:57:56 +0100 Subject: [PATCH] winepulse.drv: Use a separate mainloop and ctx for pulse_test_connect. --- - dlls/winepulse.drv/pulse.c | 62 ++++++++++++++++++-------------------- - 1 file changed, 30 insertions(+), 32 deletions(-) + dlls/winepulse.drv/pulse.c | 64 ++++++++++++++++++-------------------- + 1 file changed, 30 insertions(+), 34 deletions(-) diff --git a/dlls/winepulse.drv/pulse.c b/dlls/winepulse.drv/pulse.c -index cbd9b3b97ae..abd0f286ffc 100644 +index 28afb5b788d..67116899da7 100644 --- a/dlls/winepulse.drv/pulse.c +++ b/dlls/winepulse.drv/pulse.c -@@ -669,7 +669,8 @@ static void convert_channel_map(const pa_channel_map *pa_map, WAVEFORMATEXTENSIB +@@ -681,7 +681,8 @@ static void convert_channel_map(const pa_channel_map *pa_map, WAVEFORMATEXTENSIB fmt->dwChannelMask = pa_mask; } @@ -22,7 +22,7 @@ index cbd9b3b97ae..abd0f286ffc 100644 { WAVEFORMATEX *wfx = &fmt->Format; pa_stream *stream; -@@ -692,7 +693,7 @@ static void pulse_probe_settings(int render, const char *pulse_name, WAVEFORMATE +@@ -704,7 +705,7 @@ static void pulse_probe_settings(int render, const char *pulse_name, WAVEFORMATE attr.minreq = attr.fragsize = pa_frame_size(&ss); attr.prebuf = 0; @@ -31,7 +31,7 @@ index cbd9b3b97ae..abd0f286ffc 100644 if (stream) pa_stream_set_state_callback(stream, pulse_stream_state, NULL); if (!stream) -@@ -703,7 +704,7 @@ static void pulse_probe_settings(int render, const char *pulse_name, WAVEFORMATE +@@ -715,7 +716,7 @@ static void pulse_probe_settings(int render, const char *pulse_name, WAVEFORMATE else ret = pa_stream_connect_record(stream, pulse_name, &attr, PA_STREAM_START_CORKED|PA_STREAM_FIX_RATE|PA_STREAM_FIX_CHANNELS|PA_STREAM_EARLY_REQUESTS); if (ret >= 0) { @@ -40,7 +40,7 @@ index cbd9b3b97ae..abd0f286ffc 100644 pa_stream_get_state(stream) == PA_STREAM_CREATING) {} if (pa_stream_get_state(stream) == PA_STREAM_READY) { -@@ -714,7 +715,7 @@ static void pulse_probe_settings(int render, const char *pulse_name, WAVEFORMATE +@@ -726,7 +727,7 @@ static void pulse_probe_settings(int render, const char *pulse_name, WAVEFORMATE else length = pa_stream_get_buffer_attr(stream)->fragsize; pa_stream_disconnect(stream); @@ -49,10 +49,10 @@ index cbd9b3b97ae..abd0f286ffc 100644 pa_stream_get_state(stream) == PA_STREAM_READY) {} } -@@ -761,31 +762,32 @@ static NTSTATUS pulse_test_connect(void *args) - PhysDevice *dev; +@@ -774,34 +775,33 @@ static NTSTATUS pulse_test_connect(void *args) pa_operation *o; int ret; + char *name = wstr_to_str(params->name); + pa_mainloop *ml; + pa_context *ctx; @@ -61,11 +61,14 @@ index cbd9b3b97ae..abd0f286ffc 100644 + ml = pa_mainloop_new(); - pa_mainloop_set_poll_func(pulse_ml, pulse_poll_func, NULL); +- +- pulse_ctx = pa_context_new(pa_mainloop_get_api(pulse_ml), name); + pa_mainloop_set_poll_func(ml, pulse_poll_func, NULL); -- pulse_ctx = pa_context_new(pa_mainloop_get_api(pulse_ml), params->name); ++ ctx = pa_context_new(pa_mainloop_get_api(ml), name); + free(name); +- - if (!pulse_ctx) { -+ ctx = pa_context_new(pa_mainloop_get_api(ml), params->name); + if (!ctx) { ERR("Failed to create context\n"); - pa_mainloop_free(pulse_ml); @@ -93,7 +96,7 @@ index cbd9b3b97ae..abd0f286ffc 100644 if (state == PA_CONTEXT_FAILED || state == PA_CONTEXT_TERMINATED) goto fail; -@@ -794,12 +796,12 @@ static NTSTATUS pulse_test_connect(void *args) +@@ -810,12 +810,12 @@ static NTSTATUS pulse_test_connect(void *args) break; } @@ -109,7 +112,7 @@ index cbd9b3b97ae..abd0f286ffc 100644 free_phys_device_lists(); list_init(&g_phys_speakers); -@@ -808,34 +810,32 @@ static NTSTATUS pulse_test_connect(void *args) +@@ -824,34 +824,32 @@ static NTSTATUS pulse_test_connect(void *args) pulse_add_device(&g_phys_speakers, NULL, 0, Speakers, 0, "", "PulseAudio"); pulse_add_device(&g_phys_sources, NULL, 0, Microphone, 0, "", "PulseAudio"); @@ -152,7 +155,7 @@ index cbd9b3b97ae..abd0f286ffc 100644 pulse_unlock(); -@@ -843,10 +843,8 @@ static NTSTATUS pulse_test_connect(void *args) +@@ -859,10 +857,8 @@ static NTSTATUS pulse_test_connect(void *args) return STATUS_SUCCESS; fail: @@ -166,5 +169,5 @@ index cbd9b3b97ae..abd0f286ffc 100644 params->priority = Priority_Unavailable; return STATUS_SUCCESS; -- -2.35.1 +2.39.2 diff --git a/staging/upstream-commit b/staging/upstream-commit index f2ce1016..f66b0080 100644 --- a/staging/upstream-commit +++ b/staging/upstream-commit @@ -1 +1 @@ -e796002ee61bf5dfb2718e8f4fb8fa928ccdc236 +45e83cc8c28cece236f1537958f6e21b48193f2c