Fix calculation for estimate of dropped packets

Sometimes "expected" seems to fall behind which gives negative
values for the estimate.
This commit is contained in:
Aaro Altonen 2020-08-26 10:55:42 +03:00
parent 6d9a2c1df3
commit ea8f1d2039
1 changed files with 2 additions and 1 deletions

View File

@ -385,7 +385,8 @@ void uvg_rtp::rtcp::update_session_statistics(uvg_rtp::frame::rtp_frame *frame)
int extended_max = p->stats.cycles + p->stats.max_seq;
int expected = extended_max - p->stats.base_seq + 1;
p->stats.dropped_pkts = expected - p->stats.received_pkts;
int dropped = expected - p->stats.received_pkts;
p->stats.dropped_pkts = dropped >= 0 ? dropped : 0;
int arrival =
p->stats.initial_rtp +