MT#55283 transcode: do not write the sequencer position into the SRTP receive index

stats->ext_seq has been the SRTP receive index since srtp_index moved into
shm (08c7f5853d). The transcode sequencer overwrote it after every
emitted packet with its own roc<<16|seq, which lags the received packets
and, whenever the sequencer emits a late or replayed packet with a lower
sequence number, carries a roc that was incremented without a real
wrap-around. packet_index() then estimated the wrong index, and once the
sender's real roc reached 1 none of the fallback guesses matched, so every
packet of the stream failed authentication until the call ended.

packet_index() already maintains the index for every received packet, so
drop the write. Also make the sequencer's own roc increment only on a
forward wrap-around, never on a backwards step.

Closes #2221

Change-Id: Ia38bf8cbc63dd3435717927f1adfd81ac94ea347
(cherry picked from commit 956d7add09)
(cherry picked from commit ff56b32f81)
mr26.3.1
Arman Bahlakeh 3 weeks ago committed by Richard Fuchs
parent f860b7c05c
commit f14f94d617

@ -2422,7 +2422,10 @@ static int __handler_func_sequencer(struct media_packet *mp, struct transcode_pa
}
ssrc_in->packets_lost = seq->lost_count;
atomic_set_na(&ssrc_in->stats->ext_seq, seq->ext_seq);
// stats->ext_seq is the SRTP receive index (packet_index() in rtp.c and the
// kernel module) and is already updated for every received packet. The
// sequencer's position is an emission position that can legitimately move
// backwards, so it must not be written into the receive index.
ilogs(transcoding, LOG_DEBUG, "Processing RTP packet: seq %u, TS %lu",
packet->p.seq, packet->ts);

@ -590,7 +590,9 @@ out:;
ps->a_nxt = -1u;
unsigned int ext_seq = ps->roc << 16 | packet->seq;
while (ext_seq < ps->ext_seq) {
// a lower seq is a rollover only if it is far behind (forward wrap-around),
// not when a late or replayed packet is emitted
while (ext_seq < ps->ext_seq && ps->ext_seq - ext_seq >= 0x8000) {
ps->roc++;
ext_seq += 0x10000;
}

Loading…
Cancel
Save