res_rtp_asterisk.c: Set Mark on rtp when timestamp skew is too big

Set Mark bit in rtp stream when timestamp skew is bigger than MAX_TIMESTAMP_SKEW.

Fixes: #927
(cherry picked from commit 2599aa3be0)
releases/22.4
Viktor Litvinov 1 year ago committed by Asterisk Development Team
parent 7d681cbd90
commit ada5a706b7

@ -5267,6 +5267,11 @@ static int rtp_raw_write(struct ast_rtp_instance *instance, struct ast_frame *fr
} }
if (ast_test_flag(frame, AST_FRFLAG_HAS_TIMING_INFO)) { if (ast_test_flag(frame, AST_FRFLAG_HAS_TIMING_INFO)) {
if (abs(frame->ts * rate - (int)rtp->lastts) > MAX_TIMESTAMP_SKEW) {
ast_verbose("(%p) RTP audio difference is %d set mark\n",
instance, abs(frame->ts * rate - (int)rtp->lastts));
mark = 1;
}
rtp->lastts = frame->ts * rate; rtp->lastts = frame->ts * rate;
} }

Loading…
Cancel
Save