Browse Source

MT#56856 ignore reversed TS update

Ignore the updated TS from the kernel module if the current TS kept in
userspace seems newer.

Change-Id: I9ec099a6fa89641fa2e46880dc2e8c2689d8d3f6
pull/1657/head
Richard Fuchs 3 years ago
parent
commit
684174d608
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      daemon/media_socket.c

+ 6
- 1
daemon/media_socket.c View File

@ -1699,9 +1699,14 @@ static void __stream_consume_stats(struct packet_stream *ps, const struct rtpeng
atomic64_add(&ssrc_ctx->octets, stats_info->ssrc_stats[u].basic_stats.bytes); atomic64_add(&ssrc_ctx->octets, stats_info->ssrc_stats[u].basic_stats.bytes);
parent->packets_lost += stats_info->ssrc_stats[u].total_lost; // XXX should be atomic? parent->packets_lost += stats_info->ssrc_stats[u].total_lost; // XXX should be atomic?
atomic64_set(&ssrc_ctx->last_seq, stats_info->ssrc_stats[u].ext_seq); atomic64_set(&ssrc_ctx->last_seq, stats_info->ssrc_stats[u].ext_seq);
atomic64_set(&ssrc_ctx->last_ts, stats_info->ssrc_stats[u].timestamp);
parent->jitter = stats_info->ssrc_stats[u].jitter; parent->jitter = stats_info->ssrc_stats[u].jitter;
// update TS only if ahead or very different
uint64_t ts = atomic64_get(&ssrc_ctx->last_ts);
uint64_t diff = ts - stats_info->ssrc_stats[u].timestamp;
if (diff > 1000000)
atomic64_set(&ssrc_ctx->last_ts, stats_info->ssrc_stats[u].timestamp);
RTPE_STATS_ADD(packets_lost, stats_info->ssrc_stats[u].total_lost); RTPE_STATS_ADD(packets_lost, stats_info->ssrc_stats[u].total_lost);
atomic64_add(&ps->selected_sfd->local_intf->stats.s.packets_lost, atomic64_add(&ps->selected_sfd->local_intf->stats.s.packets_lost,
stats_info->ssrc_stats[u].total_lost); stats_info->ssrc_stats[u].total_lost);


Loading…
Cancel
Save