[gnome-remote-desktop] rdp: Move DVC instance checks into session-rdp



commit 1033906cd4ca5c5f1acfa3d80348619818f6dc20
Author: Pascal Nowack <Pascal Nowack gmx de>
Date:   Tue Aug 2 18:44:16 2022 +0200

    rdp: Move DVC instance checks into session-rdp

 src/grd-rdp-audio-playback.c    | 3 ---
 src/grd-rdp-display-control.c   | 3 ---
 src/grd-rdp-graphics-pipeline.c | 3 ---
 src/grd-session-rdp.c           | 9 ++++++---
 4 files changed, 6 insertions(+), 12 deletions(-)
---
diff --git a/src/grd-rdp-audio-playback.c b/src/grd-rdp-audio-playback.c
index da216f63..7fee68b8 100644
--- a/src/grd-rdp-audio-playback.c
+++ b/src/grd-rdp-audio-playback.c
@@ -137,9 +137,6 @@ grd_rdp_audio_playback_maybe_init (GrdRdpAudioPlayback *audio_playback)
 {
   RdpsndServerContext *rdpsnd_context;
 
-  if (!audio_playback)
-    return;
-
   if (audio_playback->channel_opened || audio_playback->channel_unavailable)
     return;
 
diff --git a/src/grd-rdp-display-control.c b/src/grd-rdp-display-control.c
index 15b0f302..62a40154 100644
--- a/src/grd-rdp-display-control.c
+++ b/src/grd-rdp-display-control.c
@@ -73,9 +73,6 @@ grd_rdp_display_control_maybe_init (GrdRdpDisplayControl *display_control)
 {
   DispServerContext *disp_context;
 
-  if (!display_control)
-    return;
-
   if (display_control->channel_opened || display_control->channel_unavailable)
     return;
 
diff --git a/src/grd-rdp-graphics-pipeline.c b/src/grd-rdp-graphics-pipeline.c
index 799bb4a2..99ac53cc 100644
--- a/src/grd-rdp-graphics-pipeline.c
+++ b/src/grd-rdp-graphics-pipeline.c
@@ -1397,9 +1397,6 @@ grd_rdp_graphics_pipeline_maybe_init (GrdRdpGraphicsPipeline *graphics_pipeline)
 {
   RdpgfxServerContext *rdpgfx_context;
 
-  if (!graphics_pipeline)
-    return;
-
   if (graphics_pipeline->channel_opened)
     return;
 
diff --git a/src/grd-session-rdp.c b/src/grd-session-rdp.c
index 2d9dac3a..6631bcc4 100644
--- a/src/grd-session-rdp.c
+++ b/src/grd-session-rdp.c
@@ -2289,9 +2289,12 @@ socket_thread_func (gpointer data)
               audio_playback = rdp_peer_context->audio_playback;
               display_control = rdp_peer_context->display_control;
 
-              grd_rdp_graphics_pipeline_maybe_init (graphics_pipeline);
-              grd_rdp_audio_playback_maybe_init (audio_playback);
-              grd_rdp_display_control_maybe_init (display_control);
+              if (graphics_pipeline)
+                grd_rdp_graphics_pipeline_maybe_init (graphics_pipeline);
+              if (audio_playback)
+                grd_rdp_audio_playback_maybe_init (audio_playback);
+              if (display_control)
+                grd_rdp_display_control_maybe_init (display_control);
               g_mutex_unlock (&rdp_peer_context->channel_mutex);
               break;
             }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]