[vlc-devel] commit: rtp sout: factor out some SDP code (Pierre Ynard )
git version control
git at videolan.org
Sat Jan 23 01:14:33 CET 2010
vlc | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Sat Jan 23 01:14:10 2010 +0100| [65113f55d63c9995b9ec781e75d531a9bd20d848] | committer: Pierre Ynard
rtp sout: factor out some SDP code
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=65113f55d63c9995b9ec781e75d531a9bd20d848
---
modules/stream_out/rtp.c | 36 ++++++++++++++++++------------------
1 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/modules/stream_out/rtp.c b/modules/stream_out/rtp.c
index c9568c8..a6b4fd6 100644
--- a/modules/stream_out/rtp.c
+++ b/modules/stream_out/rtp.c
@@ -784,12 +784,29 @@ char *SDPGenerate( const sout_stream_t *p_stream, const char *rtsp_url )
if( rtsp_url != NULL )
sdp_AddAttribute ( &psz_sdp, "control", "%s", rtsp_url );
+ const char *proto = "RTP/AVP"; /* protocol */
+ if( rtsp_url == NULL )
+ {
+ switch( p_sys->proto )
+ {
+ case IPPROTO_UDP:
+ break;
+ case IPPROTO_TCP:
+ proto = "TCP/RTP/AVP";
+ break;
+ case IPPROTO_DCCP:
+ proto = "DCCP/RTP/AVP";
+ break;
+ case IPPROTO_UDPLITE:
+ return psz_sdp;
+ }
+ }
+
/* FIXME: locking?! */
for( i = 0; i < p_sys->i_es; i++ )
{
sout_stream_id_t *id = p_sys->es[i];
const char *mime_major; /* major MIME type */
- const char *proto = "RTP/AVP"; /* protocol */
switch( id->i_cat )
{
@@ -806,23 +823,6 @@ char *SDPGenerate( const sout_stream_t *p_stream, const char *rtsp_url )
continue;
}
- if( rtsp_url == NULL )
- {
- switch( p_sys->proto )
- {
- case IPPROTO_UDP:
- break;
- case IPPROTO_TCP:
- proto = "TCP/RTP/AVP";
- break;
- case IPPROTO_DCCP:
- proto = "DCCP/RTP/AVP";
- break;
- case IPPROTO_UDPLITE:
- continue;
- }
- }
-
sdp_AddMedia( &psz_sdp, mime_major, proto, inclport * id->i_port,
id->i_payload_type, false, id->i_bitrate,
id->psz_enc, id->i_clock_rate, id->i_channels,
More information about the vlc-devel
mailing list