[Live-devel] Packets and delay
Ross Finlayson
finlayson at live555.com
Thu Sep 5 14:45:15 PDT 2013
> Can you please explain what happens when a packet is being delayed? I seem to understand that each packet has a life time and it gets discarded when its time is up. Does lives555 wait for the following packets to arrive, or does it continue delivering packets to client and then deliver the previous packets (out of order?).
Our "RTPSource" class (and subclasses) *always* delivers (the payload of) incoming RTP packets in order. In other words, data is *never* delivered out-of-order, even if incoming RTP packets happen to be misordered.
If there is no packet loss - or misordering - in the network, then our code always delivers (the payload of) incoming RTP packets without delay. I.e., if the last-received RTP packet had RTP sequence number N, and the next incoming packet has RTP sequence number N+1 (mod 65536), then this next incoming packet is always delivered immediately.
If, however, the next incoming packet has RTP sequence number N+2 (or later), then its payload is not delivered immediately. Instead, it is delayed by the 'packet reordering threshold', to see what subsequent packets happen to arrive. If packet N+1 arrives before the 'packet reordering threshold' time, then it will then get delivered, followed by (the already-arrived) packet N+2.
If, however, the 'packet reordering threshold' threshold elapses without packet N+1 arriving, then (the already-arrived) packet N+2 will get delivered instead. In this case, packet N+1 will never get delivered, even if it happens to arrive later.
By default, the 'packet reordering threshold' is 100 ms. Therefore, incoming packets may be delayed by this time - but *only* if there is packet loss in the network. It's important to understand that this is the *only* place in our code where incoming packets may be delayed before being delivered. If you are seeing delays greater than 100ms, then it is *not* happening in our code, so don't waste your time looking for it there.
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20130906/5620d8b9/attachment.html>
More information about the live-devel
mailing list