[Spice-devel] [PATCH spice-gtk] Fix occasional black screen at startup

Christophe de Dinechin christophe at dinechin.org
Thu Jul 13 16:44:09 UTC 2017


From: Christophe de Dinechin <dinechin at redhat.com>

The problem occurs when we call spice_playback_channel_set_delay before
the channel had received any data setting c->last_time, but after
session initialization had set mm_time in the session. The result was
that the (good) value in session->mm_time would be overwritten with 0.

Signed-off-by: Christophe de Dinechin <dinechin at redhat.com>
---
 src/channel-playback.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/channel-playback.c b/src/channel-playback.c
index ca14b96..f5acf23 100644
--- a/src/channel-playback.c
+++ b/src/channel-playback.c
@@ -471,7 +471,8 @@ void spice_playback_channel_set_delay(SpicePlaybackChannel *channel, guint32 del
 
     session = spice_channel_get_session(SPICE_CHANNEL(channel));
     if (session) {
-        spice_session_set_mm_time(session, c->last_time - delay_ms);
+        if (c->last_time != 0)
+            spice_session_set_mm_time(session, c->last_time - delay_ms);
     } else {
         CHANNEL_DEBUG(channel, "channel detached from session, mm time skipped");
     }
-- 
2.11.0 (Apple Git-81)



More information about the Spice-devel mailing list