[PATCH 5/6] winecoreaudio: Always start the notification thread.
Andrew Eikum
aeikum at codeweavers.com
Wed Dec 1 08:46:01 CST 2021
Signed-off-by: Andrew Eikum <aeikum at codeweavers.com>
On Tue, Nov 30, 2021 at 07:56:32AM +0000, Huw Davies wrote:
> Signed-off-by: Huw Davies <huw at codeweavers.com>
> ---
> dlls/winecoreaudio.drv/coremidi.c | 9 ++-------
> dlls/winecoreaudio.drv/midi.c | 7 +------
> dlls/winecoreaudio.drv/unixlib.h | 1 -
> 3 files changed, 3 insertions(+), 14 deletions(-)
>
> diff --git a/dlls/winecoreaudio.drv/coremidi.c b/dlls/winecoreaudio.drv/coremidi.c
> index 5777236bd26..8c09d4a2c1b 100644
> --- a/dlls/winecoreaudio.drv/coremidi.c
> +++ b/dlls/winecoreaudio.drv/coremidi.c
> @@ -417,19 +417,14 @@ NTSTATUS midi_init(void *args)
> dests[i].caps.wNotes = 0;
> }
>
> - params->num_srcs = num_srcs;
> -
> *params->err = DRV_SUCCESS;
> return STATUS_SUCCESS;
> }
>
> NTSTATUS midi_release(void *args)
> {
> - if (num_srcs)
> - {
> - /* stop the notify_wait thread */
> - notify_post(NULL);
> - }
> + /* stop the notify_wait thread */
> + notify_post(NULL);
>
> if (midi_client) MIDIClientDispose(midi_client); /* MIDIClientDispose will close all ports */
>
> diff --git a/dlls/winecoreaudio.drv/midi.c b/dlls/winecoreaudio.drv/midi.c
> index 262713dd003..6191885553a 100644
> --- a/dlls/winecoreaudio.drv/midi.c
> +++ b/dlls/winecoreaudio.drv/midi.c
> @@ -45,8 +45,6 @@
>
> WINE_DEFAULT_DEBUG_CHANNEL(midi);
>
> -static DWORD MIDIIn_NumDevs = 0;
> -
> static void notify_client(struct notify_context *notify)
> {
> TRACE("dev_id=%d msg=%d param1=%04lX param2=%04lX\n", notify->dev_id, notify->msg, notify->param_1, notify->param_2);
> @@ -87,10 +85,7 @@ static LONG CoreAudio_MIDIInit(void)
> return err;
> }
>
> - MIDIIn_NumDevs = params.num_srcs;
> -
> - if (MIDIIn_NumDevs > 0)
> - CloseHandle(CreateThread(NULL, 0, notify_thread, NULL, 0, NULL));
> + CloseHandle(CreateThread(NULL, 0, notify_thread, NULL, 0, NULL));
>
> return err;
> }
> diff --git a/dlls/winecoreaudio.drv/unixlib.h b/dlls/winecoreaudio.drv/unixlib.h
> index d44a7a013e8..bd9a5ce03bd 100644
> --- a/dlls/winecoreaudio.drv/unixlib.h
> +++ b/dlls/winecoreaudio.drv/unixlib.h
> @@ -186,7 +186,6 @@ struct set_volumes_params
> struct midi_init_params
> {
> DWORD *err;
> - UINT num_srcs;
> };
>
> struct notify_context
> --
> 2.23.0
>
>
More information about the wine-devel
mailing list