diff mbox series

[10/10] dcc-send: Fix freeze when video stream is stopped during ongoing draw

Message ID 5245ba7dd46644371b7c2b8495e4650ec987c598.1740651328.git.michael.scherle@rz.uni-freiburg.de (mailing list archive)
State New
Headers show
Series dcc: Create a stream for non-gl/remote clients that want to use dmabuf (v9) | expand

Commit Message

Michael Scherle Feb. 27, 2025, 11:03 a.m. UTC
Prevent a freeze that occurs if the video stream is stopped while a
gl draw is in progress (e.g., when the client requests a new codec).
Ensure proper cleanup of the ongoing gl draw.

Signed-off-by: Michael Scherle <michael.scherle@rz.uni-freiburg.de>
---
 server/dcc-send.cpp | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/server/dcc-send.cpp b/server/dcc-send.cpp
index 7bc20a22..71873563 100644
--- a/server/dcc-send.cpp
+++ b/server/dcc-send.cpp
@@ -2383,6 +2383,10 @@  static void marshall_gl_draw(DisplayChannelClient *dcc,
         spice_marshall_msg_display_gl_draw(m, &p->draw);
     } else if (DCC_TO_DC(dcc)->priv->gl_draw_stream) {
         red_marshall_gl_draw_stream(dcc, m);
+    } else if (dcc->priv->gl_draw_ongoing) {
+        DisplayChannel *display = DCC_TO_DC(dcc);
+        dcc->priv->gl_draw_ongoing = false;
+        display_channel_gl_draw_done(display);
     } else {
         spice_warning("nothing to send to the client");
     }