From d09c9b43e0c6df4cab5f673492df8d15ccd79963 Mon Sep 17 00:00:00 2001 From: Francois Gouget Date: Thu, 16 May 2019 01:11:56 +0200 Subject: [PATCH] reds: Enable mm_time adjustments on startup This reinstates the reds_enable_mm_time() call in do_spice_init() that was removed by commit c541d7e29dc0. We send mm_time adjustments to the client whenever there is no audio playback. There is no audio playback on startup. Therefore mm_time_enabled must be true on startup. QED. This fixes adjusting the client mm_time whenever playing a silent video (or full desktop stream) when no sound has been played before such as when using Xspice, booting an OS with no startup or login jingle, or possibly when migrating a VM (per commit 1c154ea5ecc3). Signed-off-by: Francois Gouget Acked-by: Frediano Ziglio --- server/reds.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/reds.c b/server/reds.c index d658103e..792e9838 100644 --- a/server/reds.c +++ b/server/reds.c @@ -3570,6 +3570,11 @@ static int do_spice_init(RedsState *reds, SpiceCoreInterface *core_interface) if (!(reds->mig_timer = reds->core.timer_add(&reds->core, migrate_timeout, reds))) { spice_error("migration timer create failed"); } + /* Note that this will not actually send the mm_time to the client because + * the main channel is not connected yet. This would have been redundant + * with the RED_PIPE_ITEM_TYPE_MAIN_INIT message anyway. + */ + reds_enable_mm_time(reds); if (reds_init_net(reds) < 0) { spice_warning("Failed to open SPICE sockets");