- if( p_block->i_buffer >= p_sys->i_mtu && p_sys->b_auto_mtu &&
- p_sys->i_mtu < 32767 )
- {
- /* Increase by 100% */
- p_sys->i_mtu *= 2;
- msg_Dbg( p_access, "increasing MTU to %d", p_sys->i_mtu );
- }
-
- return p_block;
-}
-
-/*****************************************************************************
- * BlockParseRTP/BlockRTP:
- *****************************************************************************/
-static block_t *BlockParseRTP( access_t *p_access, block_t *p_block )
-{
- int i_rtp_version;
- int i_CSRC_count;
- int i_payload_type;
- int i_skip = 0;
- int i_sequence_number = 0;
-
- if( p_block == NULL )
- return NULL;
-
- if( p_block->i_buffer < RTP_HEADER_LEN )
- goto trash;
-
- /* Parse the header and make some verifications.
- * See RFC 1889 & RFC 2250. */
- i_rtp_version = ( p_block->p_buffer[0] & 0xC0 ) >> 6;
- i_CSRC_count = ( p_block->p_buffer[0] & 0x0F );
- 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_skip = 4;
- 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;
-
- /* A CSRC extension field is 32 bits in size (4 bytes) */
- if( i_skip >= p_block->i_buffer )
- goto trash;
-
- /* Return the packet without the RTP header. */
- p_block->i_buffer -= i_skip;
- p_block->p_buffer += i_skip;
-
-#define RTP_SEQ_NUM_SIZE 65536
- /* Detect RTP packet loss through tracking sequence numbers.
- * See RFC 1889. */
- if( p_access->p_sys->i_sequence_number == -1 )
- p_access->p_sys->i_sequence_number = i_sequence_number;
-
- if( ((p_access->p_sys->i_sequence_number + 1) % RTP_SEQ_NUM_SIZE) != i_sequence_number )
+ /* Read data */
+ p_block = block_New( p_access, MTU );
+ len = net_Read( p_access, (intptr_t)p_sys, NULL,
+ p_block->p_buffer, MTU, false );
+ if( len < 0 )