<div dir="ltr">ack<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 30, 2013 at 8:50 PM, Yonit Halperin <span dir="ltr"><<a href="mailto:yhalperi@redhat.com" target="_blank">yhalperi@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This bug results in the client dropping all the video frames after<br>
migration in case that (1) the hosts involved in migration have different<br>
mm-time; and that (2) there is no audio playback.<br>
This is relvant only for the client that was connected during the<br>
migration.<br>
<br>
rhbz#958276<br>
---<br>
 server/reds.c | 18 ++++++++++++++----<br>
 1 file changed, 14 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/server/reds.c b/server/reds.c<br>
index c3b5518..b8db905 100644<br>
--- a/server/reds.c<br>
+++ b/server/reds.c<br>
@@ -172,6 +172,7 @@ static void reds_mig_cleanup_wait_disconnect(void);<br>
 static void reds_mig_remove_wait_disconnect_client(RedClient *client);<br>
 static void reds_char_device_add_state(SpiceCharDeviceState *st);<br>
 static void reds_char_device_remove_state(SpiceCharDeviceState *st);<br>
+static void reds_send_mm_time(void);<br>
<br>
 static ChannelSecurityOptions *channels_security = NULL;<br>
 static int default_channel_security =<br>
@@ -1360,6 +1361,14 @@ int reds_handle_migrate_data(MainChannelClient *mcc, SpiceMigrateDataMain *mig_d<br>
 {<br>
     VDIPortState *agent_state = &reds->agent_state;<br>
<br>
+    /*<br>
+     * Now that the client has switched to the target server, if main_channel<br>
+     * controls the mm-time, we update the client's mm-time.<br>
+     * (MSG_MAIN_INIT is not sent for a migrating connection)<br>
+     */<br>
+    if (reds->mm_timer_enabled) {<br>
+        reds_send_mm_time();<br>
+    }<br>
     if (mig_data->agent_base.connected) {<br>
         if (agent_state->base) { // agent was attached before migration data has arrived<br>
             if (!vdagent) {<br>
@@ -3033,6 +3042,10 @@ listen:<br>
<br>
 static void reds_send_mm_time(void)<br>
 {<br>
+    if (!reds_main_channel_connected()) {<br>
+        return;<br>
+    }<br>
+    spice_debug(NULL);<br>
     main_channel_push_multi_media_time(reds->main_channel,<br>
                                        reds_get_mm_time() - reds->mm_time_latency);<br>
 }<br>
@@ -3483,9 +3496,6 @@ void reds_update_mm_timer(uint32_t mm_time)<br>
 void reds_enable_mm_timer(void)<br>
 {<br>
     core->timer_start(reds->mm_timer, MM_TIMER_GRANULARITY_MS);<br>
-    if (!reds_main_channel_connected()) {<br>
-        return;<br>
-    }<br>
     reds->mm_timer_enabled = TRUE;<br>
     reds->mm_time_latency = MM_TIME_DELTA;<br>
     reds_send_mm_time();<br>
@@ -3927,7 +3937,7 @@ static int do_spice_init(SpiceCoreInterface *core_interface)<br>
     if (!(reds->mm_timer = core->timer_add(mm_timer_proc, NULL))) {<br>
         spice_error("mm timer create failed");<br>
     }<br>
-    core->timer_start(reds->mm_timer, MM_TIMER_GRANULARITY_MS);<br>
+    reds_enable_mm_timer();<br>
<br>
     if (reds_init_net() < 0) {<br>
         goto err;<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.0.1<br>
<br>
_______________________________________________<br>
Spice-devel mailing list<br>
<a href="mailto:Spice-devel@lists.freedesktop.org">Spice-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/spice-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/spice-devel</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>Marc-André Lureau
</div>