[MPlayer-dev-eng] [PATCH] RTP Reorder - fix out-of-sequence packets in rtp streaming

ErniTron ernitron at fastwebnet.it
Fri May 5 10:38:37 CEST 2006


Hello List,

Attached is an RTP reordering algorithm based on cache. It adds the
basic feature of rtp sequence reordering as found in VLC and other
streaming players. Patch affects only "mplayer rtp://" streaming.

The problem arises also in broadband networks where UDP packet delivery
is not guaranteed. We have noticed in a production environment where RTP
packets can be scrambled or re-issued.

The following patch just caches out-of-order RTP packets and recovers
from scrambled or re-issued packets. Cannot recover lost packets, of
course.

Algorithm is pretty simple and code is neat (I hope).
When packets follows in order, behaviour is the same as previous MPlayer
versions. If an out-of-sequence packet is found it is put in cache 
waiting for other packets 'till the order is restored or packets limit 
is reached.

Number of packet in cache is configurable via MAXRTPPACKETSIN as in:
#define MAXRTPPACKETSIN 32
which also is the maximum distance between scrambled packets (it seems a 
lot but we have found that case in a production env.)

Cost of patch is an extension of DATA section of 32*2048=64KB for cache.

Testing the code is not that easy unless you have access to an heavy 
traffic network. I can assure patch was EXTENSIVELY tested and 
considered STABLE.

Best Regards,
Erni Tron


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.rtp.txt
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20060505/6e38e70d/attachment.txt>


More information about the MPlayer-dev-eng mailing list