diff options
author | phintuka <phintuka> | 2008-11-14 22:44:34 +0000 |
---|---|---|
committer | phintuka <phintuka> | 2008-11-14 22:44:34 +0000 |
commit | e7a1002a21f0f762d142554811fff7b6f7cdac12 (patch) | |
tree | f26514e7c38d6139cae92b3c9eedb62e3300acbb | |
parent | 6ca8893ed2c83a399f1a0d9f3dd7c1aef56c4988 (diff) | |
download | xineliboutput-e7a1002a21f0f762d142554811fff7b6f7cdac12.tar.gz xineliboutput-e7a1002a21f0f762d142554811fff7b6f7cdac12.tar.bz2 |
asprintf -> cString
-rw-r--r-- | tools/sdp.h | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/tools/sdp.h b/tools/sdp.h index 47a3a409..14cb7e6c 100644 --- a/tools/sdp.h +++ b/tools/sdp.h @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: sdp.h,v 1.2 2006-12-14 12:52:49 phintuka Exp $ + * $Id: sdp.h,v 1.3 2008-11-14 22:44:34 phintuka Exp $ * */ @@ -15,16 +15,16 @@ #define SDP_MIME_TYPE "application/sdp" -static char *vdr_sdp_description(const char *vdr_ip, - int vdr_svdrp_port, - int vdr_xineliboutput_port, - const char *rtp_ip, - uint32_t rtp_ssrc, - int rtp_port, - int rtp_ttl) +static const char *vdr_sdp_description(const char *vdr_ip, + int vdr_svdrp_port, + int vdr_xineliboutput_port, + const char *rtp_ip, + uint32_t rtp_ssrc, + int rtp_port, + int rtp_ttl) { static uint8_t s_serial = 0; - static char *s_data = NULL; + static cString s_data; static char s_hostname[257] = {0}; uint64_t serial = (time(NULL) << 2) + ((s_serial++) & 0x03); @@ -32,9 +32,7 @@ static char *vdr_sdp_description(const char *vdr_ip, if(!s_hostname[0]) gethostname(s_hostname, 256); - free(s_data); - - asprintf(&s_data, + s_data = cString::sprintf( /*** session ***/ /* version */ "v=0" /* origin */ "\r\n" "o=%s %u %"PRIu64" IN IP4 %s" @@ -86,8 +84,7 @@ static char *vdr_sdp_description(const char *vdr_ip, /* tcp control/x-svdrp */ , vdr_ip , vdr_svdrp_port - ); - + ); return s_data; } |