I recently had to investigate bad quality communication and then found a problem in the adaptive jitter buffer. I succeeded in reproducing it.
Let's see the following case:
sender ts 1000 1160 1320 1480 1640 1800
network ---|-------|-----|---------|-------|-------|--
recv --|-------|-------|-------|-------|-------|---
user ts 0 160 320 480 640 800
packet ts NULL NULL 1000 1160 NULL 1480
slide 0 840 840 840 839 840The first line is the sender timestamp, the second line when the network stack is receiving the packet.
We can see that as the receiving time is very close to the sampling time, the 3rd packet is received before the 3rd sampling. In fact the real jitter is very low (below 1ms).
The 3rd line represent when the user is calling ortp_recvm_with_ts function, the 4th is the user_ts used as argument.