[client,v3,4/6] channel-display: Remove playback_sync_drops_seq_len

Submitted by Francois Gouget on June 25, 2019, 11:44 p.m.

Details

Message ID 34fdad6bc6b152e332cc362b8477502e02857466.1561506197.git.fgouget@free.fr
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Francois Gouget June 25, 2019, 11:44 p.m.
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@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(-)

Patch hide | download patch | download mbox

diff --git a/src/channel-display-priv.h b/src/channel-display-priv.h
index 6628951d..a055b203 100644
--- a/src/channel-display-priv.h
+++ b/src/channel-display-priv.h
@@ -151,8 +151,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 9ef2054e..001fbc5c 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,
@@ -1802,10 +1798,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 656a4037..0e439eff 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 d88276f1..d0d7be8e 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 e6a96133..04a2da96 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)
 {