Skip to content

Commit

Permalink
Fix highest sequence number not being properly initialized in the RTC…
Browse files Browse the repository at this point in the history
…P context (see #2920)
  • Loading branch information
atoppi committed Mar 9, 2022
1 parent f3e7280 commit 30830e3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions rtcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -828,13 +828,16 @@ int janus_rtcp_process_incoming_rtp(janus_rtcp_context *ctx, char *packet, int l
ctx->tb = clock_rate;
/* Now parse this RTP packet header and update the rtcp_context instance */
uint16_t seq_number = ntohs(rtp->seq_number);
if(ctx->base_seq == 0 && ctx->seq_cycle == 0)
gboolean first_pkt = FALSE;
if(ctx->base_seq == 0 && ctx->seq_cycle == 0) {
ctx->base_seq = seq_number;
first_pkt = TRUE;
}

int64_t now = janus_get_monotonic_time();
if (!rfc4588_pkt) {
/* Non-RTX packet */
if ((int16_t)(seq_number - ctx->max_seq_nr) > 0) {
if ((int16_t)(seq_number - ctx->max_seq_nr) > 0 || first_pkt) {
/* In-order packet */
ctx->received++;

Expand Down

0 comments on commit 30830e3

Please sign in to comment.