[vlc-commits] rtp: inline sdp_AddAttribute()
Rémi Denis-Courmont
git at videolan.org
Wed Apr 1 21:15:40 CEST 2020
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Apr 1 22:14:03 2020 +0300| [e63df107cb1cea0f088f8585b68243fd6fe4ff84] | committer: Rémi Denis-Courmont
rtp: inline sdp_AddAttribute()
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e63df107cb1cea0f088f8585b68243fd6fe4ff84
---
modules/stream_out/rtp.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/modules/stream_out/rtp.c b/modules/stream_out/rtp.c
index f4a089e79a..506230c049 100644
--- a/modules/stream_out/rtp.c
+++ b/modules/stream_out/rtp.c
@@ -774,10 +774,10 @@ char *SDPGenerate( sout_stream_t *p_stream, const char *rtsp_url )
/* TODO: a=source-filter */
if( p_sys->rtcp_mux )
- sdp_AddAttribute( &sdp, "rtcp-mux", NULL );
+ vlc_memstream_puts(&sdp, "a=rtcp-mux\r\n");
if( rtsp_url != NULL )
- sdp_AddAttribute ( &sdp, "control", "%s", rtsp_url );
+ vlc_memstream_printf(&sdp, "a=control:%s\r\n", rtsp_url);
const char *proto = "RTP/AVP"; /* protocol */
if( rtsp_url == NULL )
@@ -825,24 +825,24 @@ char *SDPGenerate( sout_stream_t *p_stream, const char *rtsp_url )
/* cf RFC4566 §5.14 */
if( inclport && !p_sys->rtcp_mux && (id->i_port & 1) )
- sdp_AddAttribute( &sdp, "rtcp", "%u", id->i_port + 1 );
+ vlc_memstream_printf(&sdp, "a=rtcp:%u\r\n", id->i_port + 1);
if( rtsp_url != NULL )
{
char *track_url = RtspAppendTrackPath( id->rtsp_id, rtsp_url );
if( track_url != NULL )
{
- sdp_AddAttribute( &sdp, "control", "%s", track_url );
+ vlc_memstream_printf(&sdp, "a=control:%s\r\n", track_url);
free( track_url );
}
}
else
{
if( id->listen.fd != NULL )
- sdp_AddAttribute( &sdp, "setup", "passive" );
+ vlc_memstream_puts(&sdp, "a=setup:passive\r\n");
if( p_sys->proto == IPPROTO_DCCP )
- sdp_AddAttribute( &sdp, "dccp-service-code", "SC:RTP%c",
- toupper( (unsigned char)mime_major[0] ) );
+ vlc_memstream_printf(&sdp, "a=dccp-service-code:SC:RTP%c",
+ toupper((unsigned char)mime_major[0]));
}
}
More information about the vlc-commits
mailing list