summaryrefslogtreecommitdiffstats
path: root/server/reds.c
diff options
context:
space:
mode:
authorYonit Halperin <yhalperi@redhat.com>2013-04-30 14:36:06 -0400
committerYonit Halperin <yhalperi@redhat.com>2013-05-01 11:36:10 -0400
commit1c154ea5ecc33ad8169794f38feff82db7de7286 (patch)
treea1f12d53b932c8c163d06a1676794781527841c9 /server/reds.c
parentf0f8d7dd523b1a30bac7d68fad0d275c5b3805ee (diff)
downloadspice-1c154ea5ecc33ad8169794f38feff82db7de7286.tar.gz
spice-1c154ea5ecc33ad8169794f38feff82db7de7286.tar.xz
spice-1c154ea5ecc33ad8169794f38feff82db7de7286.zip
reds: fix not sending the mm-time after migration when there is no audio playback
This bug results in the client dropping all the video frames after migration in case that (1) the hosts involved in migration have different mm-time; and that (2) there is no audio playback. This is relvant only for the client that was connected during the migration. rhbz#958276
Diffstat (limited to 'server/reds.c')
-rw-r--r--server/reds.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/server/reds.c b/server/reds.c
index c3b5518c..b8db905e 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -172,6 +172,7 @@ static void reds_mig_cleanup_wait_disconnect(void);
static void reds_mig_remove_wait_disconnect_client(RedClient *client);
static void reds_char_device_add_state(SpiceCharDeviceState *st);
static void reds_char_device_remove_state(SpiceCharDeviceState *st);
+static void reds_send_mm_time(void);
static ChannelSecurityOptions *channels_security = NULL;
static int default_channel_security =
@@ -1360,6 +1361,14 @@ int reds_handle_migrate_data(MainChannelClient *mcc, SpiceMigrateDataMain *mig_d
{
VDIPortState *agent_state = &reds->agent_state;
+ /*
+ * Now that the client has switched to the target server, if main_channel
+ * controls the mm-time, we update the client's mm-time.
+ * (MSG_MAIN_INIT is not sent for a migrating connection)
+ */
+ if (reds->mm_timer_enabled) {
+ reds_send_mm_time();
+ }
if (mig_data->agent_base.connected) {
if (agent_state->base) { // agent was attached before migration data has arrived
if (!vdagent) {
@@ -3033,6 +3042,10 @@ listen:
static void reds_send_mm_time(void)
{
+ if (!reds_main_channel_connected()) {
+ return;
+ }
+ spice_debug(NULL);
main_channel_push_multi_media_time(reds->main_channel,
reds_get_mm_time() - reds->mm_time_latency);
}
@@ -3483,9 +3496,6 @@ void reds_update_mm_timer(uint32_t mm_time)
void reds_enable_mm_timer(void)
{
core->timer_start(reds->mm_timer, MM_TIMER_GRANULARITY_MS);
- if (!reds_main_channel_connected()) {
- return;
- }
reds->mm_timer_enabled = TRUE;
reds->mm_time_latency = MM_TIME_DELTA;
reds_send_mm_time();
@@ -3927,7 +3937,7 @@ static int do_spice_init(SpiceCoreInterface *core_interface)
if (!(reds->mm_timer = core->timer_add(mm_timer_proc, NULL))) {
spice_error("mm timer create failed");
}
- core->timer_start(reds->mm_timer, MM_TIMER_GRANULARITY_MS);
+ reds_enable_mm_timer();
if (reds_init_net() < 0) {
goto err;