[Spice-commits] server/dcc.c

Victor Toso de Carvalho victortoso at kemper.freedesktop.org
Fri Dec 2 08:08:15 UTC 2016


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

New commits:
commit f861d2922d522aedced1e13830550a6c822d41a5
Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Tue Nov 22 18:01:48 2016 +0100

    streaming: Stop streaming if the client reports a streaming error
    
    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 at codeweavers.com>
    Acked-by: Christophe Fergeau <cfergeau at redhat.com>
    Reviewed-by: Victor Toso <victortoso at redhat.com>

diff --git a/server/dcc.c b/server/dcc.c
index e9b438f..cf5f44c 100644
--- a/server/dcc.c
+++ b/server/dcc.c
@@ -1059,6 +1059,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",


More information about the Spice-commits mailing list