You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by jm...@apache.org on 2016/04/01 00:24:54 UTC

incubator-guacamole-server git commit: GUAC-1517: Only allocate one audio stream for RDP connection.

Repository: incubator-guacamole-server
Updated Branches:
  refs/heads/master f611ea7b6 -> facc0a794


GUAC-1517: Only allocate one audio stream for RDP connection.


Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/commit/facc0a79
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/tree/facc0a79
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/diff/facc0a79

Branch: refs/heads/master
Commit: facc0a794ef4e7f85a713d8ca42ee6c9b3396ae2
Parents: f611ea7
Author: Michael Jumper <mj...@apache.org>
Authored: Thu Mar 31 14:25:31 2016 -0700
Committer: Michael Jumper <mj...@apache.org>
Committed: Thu Mar 31 14:25:31 2016 -0700

----------------------------------------------------------------------
 src/protocols/rdp/client.c |  5 +++++
 src/protocols/rdp/rdp.c    | 34 +++++++++++++++-------------------
 2 files changed, 20 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/facc0a79/src/protocols/rdp/client.c
----------------------------------------------------------------------
diff --git a/src/protocols/rdp/client.c b/src/protocols/rdp/client.c
index 9fb6042..5132125 100644
--- a/src/protocols/rdp/client.c
+++ b/src/protocols/rdp/client.c
@@ -34,6 +34,7 @@
 #include <freerdp/cache/cache.h>
 #include <freerdp/channels/channels.h>
 #include <freerdp/freerdp.h>
+#include <guacamole/audio.h>
 #include <guacamole/client.h>
 #include <guacamole/socket.h>
 
@@ -124,6 +125,10 @@ int guac_rdp_client_free_handler(guac_client* client) {
     guac_common_ssh_uninit();
 #endif
 
+    /* Clean up audio stream, if allocated */
+    if (rdp_client->audio != NULL)
+        guac_audio_stream_free(rdp_client->audio);
+
     /* Free client data */
     guac_common_clipboard_free(rdp_client->clipboard);
     free(rdp_client);

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/facc0a79/src/protocols/rdp/rdp.c
----------------------------------------------------------------------
diff --git a/src/protocols/rdp/rdp.c b/src/protocols/rdp/rdp.c
index 0bc368f..753312b 100644
--- a/src/protocols/rdp/rdp.c
+++ b/src/protocols/rdp/rdp.c
@@ -247,21 +247,6 @@ BOOL rdp_freerdp_pre_connect(freerdp* instance) {
         guac_client_log(client, GUAC_LOG_WARNING,
                 "Failed to load cliprdr plugin. Clipboard will not work.");
 
-    /* If audio enabled, choose an encoder */
-    if (settings->audio_enabled) {
-
-        rdp_client->audio = guac_audio_stream_alloc(client, NULL,
-                GUAC_RDP_AUDIO_RATE,
-                GUAC_RDP_AUDIO_CHANNELS,
-                GUAC_RDP_AUDIO_BPS);
-
-        /* Warn if no audio encoding is available */
-        if (rdp_client->audio == NULL)
-            guac_client_log(client, GUAC_LOG_INFO,
-                    "No available audio encoding. Sound disabled.");
-
-    } /* end if audio enabled */
-
     /* If RDPSND/RDPDR required, load them */
     if (settings->printing_enabled
         || settings->drive_enabled
@@ -917,10 +902,6 @@ static int guac_rdp_handle_connection(guac_client* client) {
     freerdp_free(rdp_inst);
     rdp_client->rdp_inst = NULL;
 
-    /* Clean up audio stream, if allocated */
-    if (rdp_client->audio != NULL)
-        guac_audio_stream_free(rdp_client->audio);
-
     /* Free SVC list */
     guac_common_list_free(rdp_client->available_svc);
 
@@ -938,6 +919,21 @@ void* guac_rdp_client_thread(void* data) {
     guac_rdp_client* rdp_client = (guac_rdp_client*) client->data;
     guac_rdp_settings* settings = rdp_client->settings;
 
+    /* If audio enabled, choose an encoder */
+    if (settings->audio_enabled) {
+
+        rdp_client->audio = guac_audio_stream_alloc(client, NULL,
+                GUAC_RDP_AUDIO_RATE,
+                GUAC_RDP_AUDIO_CHANNELS,
+                GUAC_RDP_AUDIO_BPS);
+
+        /* Warn if no audio encoding is available */
+        if (rdp_client->audio == NULL)
+            guac_client_log(client, GUAC_LOG_INFO,
+                    "No available audio encoding. Sound disabled.");
+
+    } /* end if audio enabled */
+
     /* Load filesystem if drive enabled */
     if (settings->drive_enabled) {