+ * See RFC 3550. */
+ i_rtp_version = ( p_block->p_buffer[0] & 0xC0 ) >> 6;
+ i_CSRC_count = p_block->p_buffer[0] & 0x0F;
+ i_extension_flag = p_block->p_buffer[0] & 0x10;
+ i_payload_type = p_block->p_buffer[1] & 0x7F;
+ i_sequence_number = (p_block->p_buffer[2] << 8 ) + p_block->p_buffer[3];
+
+ if( i_rtp_version != 2 )
+ msg_Dbg( p_access, "RTP version is %u, should be 2", i_rtp_version );
+
+ if( i_payload_type == 14 || i_payload_type == 32)
+ i_skip = 4;
+ else if( i_payload_type != 33 )
+ msg_Dbg( p_access, "unsupported RTP payload type (%u)", i_payload_type );
+ if( i_extension_flag )
+ i_extension_length = 4 +
+ 4 * ( (p_block->p_buffer[14] << 8) + p_block->p_buffer[15] );
+
+ /* Skip header + CSRC extension field n*(32 bits) + extension */
+ i_skip += RTP_HEADER_LEN + 4*i_CSRC_count + i_extension_length;
+
+ if( i_skip >= p_block->i_buffer )
+ goto trash;
+
+ /* Return the packet without the RTP header, remember seqno in i_dts */
+ p_block->i_buffer -= i_skip;
+ p_block->p_buffer += i_skip;
+ p_block->i_pts = mdate();
+ p_block->i_dts = (mtime_t) i_sequence_number;
+
+#if 0
+ /* Emulate packet loss */
+ if ( (i_sequence_number % 4000) == 0)
+ {
+ msg_Warn( p_access, "Emulating packet drop" );
+ block_Release( p_block );
+ return NULL;
+ }
+#endif