From d35470f8af1d107b725e56850109d15b68f736a6 Mon Sep 17 00:00:00 2001 From: Norbert Federa Date: Thu, 18 Oct 2018 10:15:24 +0200 Subject: [PATCH] rdpsnd: always call rdpsnd_server_send_formats Since the rdpsnd_server_send_formats function is no longer exported we must always call it, even if the rdpsnd server application uses its own thread. --- channels/rdpsnd/server/rdpsnd_main.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/channels/rdpsnd/server/rdpsnd_main.c b/channels/rdpsnd/server/rdpsnd_main.c index 335c2204b..84c3526fb 100644 --- a/channels/rdpsnd/server/rdpsnd_main.c +++ b/channels/rdpsnd/server/rdpsnd_main.c @@ -238,12 +238,6 @@ static DWORD WINAPI rdpsnd_server_thread(LPVOID arg) events[nCount++] = context->priv->channelEvent; events[nCount++] = context->priv->StopEvent; - if ((error = rdpsnd_server_send_formats(context, context->priv->rdpsnd_pdu))) - { - WLog_ERR(TAG, "rdpsnd_server_send_formats failed with error %"PRIu32"", error); - goto out; - } - while (TRUE) { status = WaitForMultipleObjects(nCount, events, FALSE, INFINITE); @@ -274,8 +268,6 @@ static DWORD WINAPI rdpsnd_server_thread(LPVOID arg) } } -out: - if (error && context->rdpcontext) setChannelError(context->rdpcontext, error, "rdpsnd_server_thread reported an error"); @@ -696,6 +688,12 @@ static UINT rdpsnd_server_start(RdpsndServerContext* context) goto out_pdu; } + if ((error = rdpsnd_server_send_formats(context, context->priv->rdpsnd_pdu))) + { + WLog_ERR(TAG, "rdpsnd_server_send_formats failed with error %"PRIu32"", error); + goto out_lock; + } + if (priv->ownThread) { context->priv->StopEvent = CreateEvent(NULL, TRUE, FALSE, NULL); @@ -717,6 +715,7 @@ static UINT rdpsnd_server_start(RdpsndServerContext* context) } return CHANNEL_RC_OK; + out_stopEvent: CloseHandle(context->priv->StopEvent); context->priv->StopEvent = NULL;