summaryrefslogtreecommitdiff
path: root/tools/sdp.h
diff options
context:
space:
mode:
authorphintuka <phintuka>2009-02-12 11:08:15 +0000
committerphintuka <phintuka>2009-02-12 11:08:15 +0000
commit162fc0b72905e995ed8fa568f31c6c5e51086e6c (patch)
treebc3ca5c1bb3015222cc11eabe2714bac8b0c1764 /tools/sdp.h
parent97e04bad72fb592b6c0ef7f5f68d125386ca4e9a (diff)
downloadxineliboutput-unlabeled-1.2.2.tar.gz
xineliboutput-unlabeled-1.2.2.tar.bz2
Merged revision 1.3:unlabeled-1.2.2
asprintf -> cString
Diffstat (limited to 'tools/sdp.h')
-rw-r--r--tools/sdp.h25
1 files changed, 11 insertions, 14 deletions
diff --git a/tools/sdp.h b/tools/sdp.h
index 47a3a409..e56f1ebd 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.2.2.1 2009-02-12 11:08:15 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;
}