summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2015-04-29 16:16:35 +0200
committerMarc-André Lureau <marcandre.lureau@redhat.com>2015-05-07 21:50:43 +0200
commit8edd8b06c1be4fc45d2370ca287421674f090d22 (patch)
treed560891acb9556ae3de9a46aa383fe44d4b2b739
parent1d0a91d5ea7eb239d24fa58da4756fdac1b0155b (diff)
playback: do not set mm time when session-less
Channels do not hold a strong reference on the session (because session can be recycled after disconnect), do not print a warning if the channel is session-less when updating the delay.
-rw-r--r--gtk/channel-playback.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gtk/channel-playback.c b/gtk/channel-playback.c
index 9d45e1f..d8a181e 100644
--- a/gtk/channel-playback.c
+++ b/gtk/channel-playback.c
@@ -452,6 +452,7 @@ static void channel_set_handlers(SpiceChannelClass *klass)
void spice_playback_channel_set_delay(SpicePlaybackChannel *channel, guint32 delay_ms)
{
SpicePlaybackChannelPrivate *c;
+ SpiceSession *session;
g_return_if_fail(SPICE_IS_PLAYBACK_CHANNEL(channel));
@@ -459,8 +460,13 @@ void spice_playback_channel_set_delay(SpicePlaybackChannel *channel, guint32 del
c = channel->priv;
c->latency = delay_ms;
- spice_session_set_mm_time(spice_channel_get_session(SPICE_CHANNEL(channel)),
- c->last_time - delay_ms);
+
+ session = spice_channel_get_session(SPICE_CHANNEL(channel));
+ if (session) {
+ spice_session_set_mm_time(session, c->last_time - delay_ms);
+ } else {
+ CHANNEL_DEBUG(channel, "channel detached from session, mm time skipped");
+ }
}
G_GNUC_INTERNAL