[vlc-devel] Re: Handling RTP Header Extension
Jean-Paul Saman
jean-paul.saman at planet.nl
Fri Sep 30 12:10:38 CEST 2005
Since sometime I am sitting on a patch that implements RTP packet
reordering, but have been holding it back because 0.8.4-test1 is
started. I will integrate your patch and some of the modifications of
Marian Durkovik into this work and issue a separate patch on the
vlc-devel list. This to not make 0.8.4-test1 unstable unless the patch
has had enough testing.
Greetings,
Jean-Paul Saman.
Zohar Lorberbaum wrote:
>RFC 1889 allows for RTP header extensions. The extension bit, extension
>profile, extension length and the actual header extension are not being
>handled at the moment. This can cause having part of the RTP header to
>be handled as payload, thus corrupting the actual payload content
>playback.
>
>Following is a patch to latest SVN version of
>vlc-trunk/modules/access/udp.c which fixes this problem.
>
>Cheers,
>Zohar Lorberbaum
>
>
>--- udp.c 2005-09-29 17:25:50.518065600 -0700
>+++ udp-rtp-extension.c 2005-09-29 17:28:47.923161600 -0700
>@@ -328,6 +328,8 @@
> int i_payload_type;
> int i_skip = 0;
> int i_sequence_number = 0;
>+ int i_extension_bit = 0;
>+ int i_extension_length = 0;
>
> if( p_block == NULL )
> return NULL;
>@@ -342,6 +344,11 @@
> i_payload_type = ( p_block->p_buffer[1] & 0x7F );
> i_sequence_number = ( (p_block->p_buffer[2] << 8 ) +
>p_block->p_buffer[3] );
>
>+ i_extension_bit = ( p_block->p_buffer[0] & 0x10 ) >> 4;
>+
>+ if ( i_extension_bit == 1)
>+ i_extension_length = ( (p_block->p_buffer[14] << 8 ) +
>p_block->p_buffer[15] );
>+
> if ( i_rtp_version != 2 )
> msg_Dbg( p_access, "RTP version is %u, should be 2",
>i_rtp_version );
>
>@@ -350,7 +357,7 @@
> else if( i_payload_type != 33 && i_payload_type != 32 )
> msg_Dbg( p_access, "unsupported RTP payload type (%u)",
>i_payload_type );
>
>- i_skip += RTP_HEADER_LEN + 4*i_CSRC_count;
>+ i_skip += RTP_HEADER_LEN + 4*i_CSRC_count + 4*i_extension_bit +
>4*i_extension_length;
>
> /* A CSRC extension field is 32 bits in size (4 bytes) */
> if( i_skip >= p_block->i_buffer )
>
>
>
>
>
>
--
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html
More information about the vlc-devel
mailing list