# HG changeset patch # User lucabe # Date 1215675654 0 # Node ID 1489d89efd7711f89643b7d443796c9f391de957 # Parent 5ad678c7e3417dbe098e1e2d373618a737aedd0c Fix MPEG video packetization for RTP diff -r 5ad678c7e341 -r 1489d89efd77 rtp_mpv.c --- a/rtp_mpv.c Thu Jul 10 03:02:19 2008 +0000 +++ b/rtp_mpv.c Thu Jul 10 07:40:54 2008 +0000 @@ -66,7 +66,7 @@ begin_of_sequence = 1; } - if (r - buf1 < len) { + if (r - buf1 - 4 <= len) { /* The current slice fits in the packet */ if (begin_of_slice == 0) { /* no slice at the beginning of the packet... */ @@ -76,7 +76,7 @@ } r1 = r; } else { - if (r - r1 < max_packet_size - 4) { + if ((r1 - buf1 > 4) && (r - r1 < max_packet_size)) { len = r1 - buf1 - 4; end_of_slice = 1; }