[Spice-devel] [client v2 10/12] channel-display: Remove playback_sync_drops_seq_len
Francois Gouget
fgouget at codeweavers.com
Mon Jun 17 17:34:36 UTC 2019
display_handle_stream_data() now has its own mechanism to avoid
dropping frames which does not depend on the playback latency.
Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
---
src/channel-display-priv.h | 2 --
src/channel-display.c | 8 --------
src/channel-playback-priv.h | 1 -
src/channel-playback.c | 9 ---------
src/spice-session-priv.h | 1 -
src/spice-session.c | 15 ---------------
6 files changed, 36 deletions(-)
diff --git a/src/channel-display-priv.h b/src/channel-display-priv.h
index a2634ee5..7c978780 100644
--- a/src/channel-display-priv.h
+++ b/src/channel-display-priv.h
@@ -145,8 +145,6 @@ struct display_stream {
GArray *drops_seqs_stats_arr;
uint32_t num_drops_seqs;
- uint32_t playback_sync_drops_seq_len;
-
/* playback quality report to server */
gboolean report_is_active;
uint32_t report_id;
diff --git a/src/channel-display.c b/src/channel-display.c
index aee1e844..03110df6 100644
--- a/src/channel-display.c
+++ b/src/channel-display.c
@@ -1484,8 +1484,6 @@ static void display_update_stream_report(SpiceDisplayChannel *channel, uint32_t
}
}
-#define STREAM_PLAYBACK_SYNC_DROP_SEQ_LEN_LIMIT 5
-
static void display_stream_stats_debug(display_stream *st)
{
guint64 drops_duration_total = 0;
@@ -1567,7 +1565,6 @@ static void display_stream_stats_save(display_stream *st,
st->cur_drops_seq_stats.start_mm_time = frame_mmtime;
}
st->cur_drops_seq_stats.len++;
- st->playback_sync_drops_seq_len++;
return;
}
@@ -1579,7 +1576,6 @@ static void display_stream_stats_save(display_stream *st,
memset(&st->cur_drops_seq_stats, 0, sizeof(st->cur_drops_seq_stats));
st->num_drops_seqs++;
}
- st->playback_sync_drops_seq_len = 0;
}
static SpiceFrame *spice_frame_new(display_stream *st,
@@ -1800,10 +1796,6 @@ static void display_handle_stream_data(SpiceChannel *channel, SpiceMsgIn *in)
if (c->enable_adaptive_streaming) {
display_update_stream_report(SPICE_DISPLAY_CHANNEL(channel), op->id,
op->multi_media_time, mmtime_margin);
- if (st->playback_sync_drops_seq_len >= STREAM_PLAYBACK_SYNC_DROP_SEQ_LEN_LIMIT) {
- spice_session_sync_playback_latency(spice_channel_get_session(channel));
- st->playback_sync_drops_seq_len = 0;
- }
}
}
diff --git a/src/channel-playback-priv.h b/src/channel-playback-priv.h
index aa33d2c4..dc89e2d8 100644
--- a/src/channel-playback-priv.h
+++ b/src/channel-playback-priv.h
@@ -20,5 +20,4 @@
gboolean spice_playback_channel_is_active(SpicePlaybackChannel *channel);
guint32 spice_playback_channel_get_latency(SpicePlaybackChannel *channel);
-void spice_playback_channel_sync_latency(SpicePlaybackChannel *channel);
#endif
diff --git a/src/channel-playback.c b/src/channel-playback.c
index bd551b37..052e3036 100644
--- a/src/channel-playback.c
+++ b/src/channel-playback.c
@@ -495,12 +495,3 @@ guint32 spice_playback_channel_get_latency(SpicePlaybackChannel *channel)
}
return channel->priv->latency;
}
-
-G_GNUC_INTERNAL
-void spice_playback_channel_sync_latency(SpicePlaybackChannel *channel)
-{
- g_return_if_fail(SPICE_IS_PLAYBACK_CHANNEL(channel));
- g_return_if_fail(channel->priv->is_active);
- SPICE_DEBUG("%s: notify latency update %u", __FUNCTION__, channel->priv->min_latency);
- g_coroutine_object_notify(G_OBJECT(SPICE_CHANNEL(channel)), "min-latency");
-}
diff --git a/src/spice-session-priv.h b/src/spice-session-priv.h
index 794d86a7..1e91f627 100644
--- a/src/spice-session-priv.h
+++ b/src/spice-session-priv.h
@@ -86,7 +86,6 @@ void spice_session_set_uuid(SpiceSession *session, guint8 uuid[16]);
void spice_session_set_name(SpiceSession *session, const gchar *name);
gboolean spice_session_is_playback_active(SpiceSession *session);
guint32 spice_session_get_playback_latency(SpiceSession *session);
-void spice_session_sync_playback_latency(SpiceSession *session);
gboolean spice_session_get_audio_enabled(SpiceSession *session);
gboolean spice_session_get_smartcard_enabled(SpiceSession *session);
gboolean spice_session_get_usbredir_enabled(SpiceSession *session);
diff --git a/src/spice-session.c b/src/spice-session.c
index 4e5a7823..a1a96829 100644
--- a/src/spice-session.c
+++ b/src/spice-session.c
@@ -2660,21 +2660,6 @@ void spice_session_set_name(SpiceSession *session, const gchar *name)
g_coroutine_object_notify(G_OBJECT(session), "name");
}
-G_GNUC_INTERNAL
-void spice_session_sync_playback_latency(SpiceSession *session)
-{
- g_return_if_fail(SPICE_IS_SESSION(session));
-
- SpiceSessionPrivate *s = session->priv;
-
- if (s->playback_channel &&
- spice_playback_channel_is_active(s->playback_channel)) {
- spice_playback_channel_sync_latency(s->playback_channel);
- } else {
- SPICE_DEBUG("%s: not implemented when there isn't audio playback", __FUNCTION__);
- }
-}
-
G_GNUC_INTERNAL
gboolean spice_session_is_playback_active(SpiceSession *session)
{
--
2.20.1
More information about the Spice-devel
mailing list