[vlc-devel] commit: Remove some dead code ( Rémi Denis-Courmont )
git version control
git at videolan.org
Sat Jun 7 17:32:31 CEST 2008
vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sat Jun 7 18:05:24 2008 +0300| [1b44115761bd8c966bca4452e8fba9fb321e7991]
Remove some dead code
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1b44115761bd8c966bca4452e8fba9fb321e7991
---
modules/access/udp.c | 72 +-------------------------------------------------
1 files changed, 1 insertions(+), 71 deletions(-)
diff --git a/modules/access/udp.c b/modules/access/udp.c
index 401acfa..404d9e1 100644
--- a/modules/access/udp.c
+++ b/modules/access/udp.c
@@ -88,7 +88,6 @@ vlc_module_end();
static block_t *BlockUDP( access_t * );
static block_t *BlockStartRTP( access_t * );
static block_t *BlockRTP( access_t * );
-static block_t *BlockChoose( access_t * );
static int Control( access_t *, int, va_list );
struct access_sys_t
@@ -140,7 +139,7 @@ static int Open( vlc_object_t *p_this )
}
if (strncmp (p_access->psz_access, "udp", 3 ) == 0 )
- p_access->pf_block = BlockChoose;
+ p_access->pf_block = BlockUDP;
else
if (strcmp (p_access->psz_access, "rtptcp") == 0)
proto = IPPROTO_TCP;
@@ -661,72 +660,3 @@ static block_t *BlockStartRTP( access_t *p_access )
p_access->pf_block = BlockRTP;
return BlockPrebufferRTP( p_access, BlockUDP( p_access ) );
}
-
-
-/*****************************************************************************
- * BlockChoose: decide between RTP and UDP
- *****************************************************************************/
-static block_t *BlockChoose( access_t *p_access )
-{
- block_t *p_block;
- int i_rtp_version;
- int i_payload_type;
-
- if( ( p_block = BlockUDP( p_access ) ) == NULL )
- return NULL;
-
- if( p_block->p_buffer[0] == 0x47 )
- {
- msg_Dbg( p_access, "detected TS over raw UDP" );
- p_access->pf_block = BlockUDP;
- p_access->info.b_prebuffered = true;
- return p_block;
- }
-
- if( p_block->i_buffer < RTP_HEADER_LEN )
- return p_block;
-
- /* Parse the header and make some verifications.
- * See RFC 3550. */
-
- i_rtp_version = p_block->p_buffer[0] >> 6;
- i_payload_type = ( p_block->p_buffer[1] & 0x7F );
-
- if( i_rtp_version != 2 )
- {
- msg_Dbg( p_access, "no supported RTP header detected" );
- p_access->pf_block = BlockUDP;
- p_access->info.b_prebuffered = true;
- return p_block;
- }
-
- switch( i_payload_type )
- {
- case 33:
- msg_Dbg( p_access, "detected MPEG2 TS over RTP" );
- free( p_access->psz_demux );
- p_access->psz_demux = strdup( "ts" );
- break;
-
- case 14:
- msg_Dbg( p_access, "detected MPEG Audio over RTP" );
- free( p_access->psz_demux );
- p_access->psz_demux = strdup( "mpga" );
- break;
-
- case 32:
- msg_Dbg( p_access, "detected MPEG Video over RTP" );
- free( p_access->psz_demux );
- p_access->psz_demux = strdup( "mpgv" );
- break;
-
- default:
- msg_Dbg( p_access, "no RTP header detected" );
- p_access->pf_block = BlockUDP;
- p_access->info.b_prebuffered = true;
- return p_block;
- }
-
- p_access->pf_block = BlockRTP;
- return BlockPrebufferRTP( p_access, p_block );
-}
More information about the vlc-devel
mailing list