Rename mm_timer/mm_time

As suggested by Christophe on the mailing list.
This commit is contained in:
Marc-André Lureau 2014-11-27 14:30:58 +01:00
parent c541d7e29d
commit ea4e9f28bf
4 changed files with 13 additions and 13 deletions

View File

@ -175,7 +175,7 @@ typedef struct RedsState {
int allow_multiple_clients;
RedsClientMonitorsConfig client_monitors_config;
int mm_timer_enabled;
int mm_time_enabled;
uint32_t mm_time_latency;
} RedsState;

View File

@ -1280,7 +1280,7 @@ int reds_handle_migrate_data(MainChannelClient *mcc, SpiceMigrateDataMain *mig_d
* 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) {
if (reds->mm_time_enabled) {
reds_send_mm_time();
}
if (mig_data->agent_base.connected) {
@ -2423,7 +2423,7 @@ static void reds_send_mm_time(void)
void reds_set_client_mm_time_latency(RedClient *client, uint32_t latency)
{
// TODO: multi-client support for mm_time
if (reds->mm_timer_enabled) {
if (reds->mm_time_enabled) {
// TODO: consider network latency
if (latency > reds->mm_time_latency) {
reds->mm_time_latency = latency;
@ -2828,16 +2828,16 @@ uint32_t reds_get_mm_time(void)
return time_space.tv_sec * 1000 + time_space.tv_nsec / 1000 / 1000;
}
void reds_enable_mm_timer(void)
void reds_enable_mm_time(void)
{
reds->mm_timer_enabled = TRUE;
reds->mm_time_enabled = TRUE;
reds->mm_time_latency = MM_TIME_DELTA;
reds_send_mm_time();
}
void reds_disable_mm_timer(void)
void reds_disable_mm_time(void)
{
reds->mm_timer_enabled = FALSE;
reds->mm_time_enabled = FALSE;
}
static SpiceCharDeviceState *attach_to_red_agent(SpiceCharDeviceInstance *sin)

View File

@ -54,8 +54,8 @@ typedef struct RedsMigSpice {
/* main thread only */
void reds_handle_channel_event(int event, SpiceChannelEventInfo *info);
void reds_disable_mm_timer(void);
void reds_enable_mm_timer(void);
void reds_disable_mm_time(void);
void reds_enable_mm_time(void);
uint32_t reds_get_mm_time(void);
void reds_set_client_mouse_allowed(int is_client_mouse_allowed,
int x_res, int y_res);

View File

@ -1041,7 +1041,7 @@ SPICE_GNUC_VISIBLE void spice_server_playback_start(SpicePlaybackInstance *sin)
if (!channel)
return;
spice_assert(!playback_channel->base.active);
reds_disable_mm_timer();
reds_disable_mm_time();
playback_channel->base.active = TRUE;
if (!playback_channel->base.client_active) {
snd_set_command(&playback_channel->base, SND_PLAYBACK_CTRL_MASK);
@ -1060,7 +1060,7 @@ SPICE_GNUC_VISIBLE void spice_server_playback_stop(SpicePlaybackInstance *sin)
if (!channel)
return;
spice_assert(playback_channel->base.active);
reds_enable_mm_timer();
reds_enable_mm_time();
playback_channel->base.active = FALSE;
if (playback_channel->base.client_active) {
snd_set_command(&playback_channel->base, SND_PLAYBACK_CTRL_MASK);
@ -1174,7 +1174,7 @@ static void on_new_playback_channel(SndWorker *worker)
snd_set_command((SndChannel *)playback_channel, SND_PLAYBACK_VOLUME_MASK);
}
if (playback_channel->base.active) {
reds_disable_mm_timer();
reds_disable_mm_time();
}
}
@ -1183,7 +1183,7 @@ static void snd_playback_cleanup(SndChannel *channel)
PlaybackChannel *playback_channel = SPICE_CONTAINEROF(channel, PlaybackChannel, base);
if (playback_channel->base.active) {
reds_enable_mm_timer();
reds_enable_mm_time();
}
snd_codec_destroy(&playback_channel->codec);