[spice v5 4/4] streaming: Stop streaming if the client reports a streaming error

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

 



By removing the stream's video encoder we force the stream to send 
future frames using the fallback code, that is as regular screen 
updates.
However note that we keep the stream object: we have to. Otherwise 
future frames would trigger the creation of a new stream object with a 
new video encoder which would again try to stream the video and fail 
again and again.

Signed-off-by: Francois Gouget <fgouget@xxxxxxxxxxxxxxx>
---

Updated the commit log.

 server/dcc.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/server/dcc.c b/server/dcc.c
index d430d43..97b6280 100644
--- a/server/dcc.c
+++ b/server/dcc.c
@@ -1060,6 +1060,15 @@ static int dcc_handle_stream_report(DisplayChannelClient *dcc,
         return TRUE;
     }
 
+    if (report->num_frames == 0 && report->num_drops == UINT_MAX) {
+        spice_warning("stream_report: the client does not support stream %u",
+                      report->stream_id);
+        /* Stop streaming the video so the client can see it */
+        agent->video_encoder->destroy(agent->video_encoder);
+        agent->video_encoder = NULL;
+        return TRUE;
+    }
+
     if (report->unique_id != agent->report_id) {
         spice_warning("stream_report: unique id mismatch: local (%u) != msg (%u) "
                       "The old stream was probably replaced by a new one",
-- 
2.10.1
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]