Changeset 3ce51320ea315d088049a672bc9fe8b308b3a4fa

Show
Ignore:
Timestamp:
05/01/07 19:18:46 (1 year ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1178039926 +0000
git-parent:

[60db87243c9426e59557d0f0f2e30276cc2f9c94]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1178039926 +0000
Message:

Provide va_list variant to MakeSDPMedia

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/stream_output/sdp.c

    r60db872 r3ce5132  
    55 * $Id$ 
    66 * 
    7  * Authors: Rémi Denis-Courmont 
    8  * 
    97 * This program is free software; you can redistribute it and/or modify 
    10  * it under the terms of the GNU General Public License as published by 
    11  * the Free Software Foundation; either version 2 of the License, or 
     8 * it under the terms of the GNU Lesser General Public License as published by 
     9 * the Free Software Foundation; either version 2.1 of the License, or 
    1210 * (at your option) any later version. 
    1311 * 
     
    154152 
    155153 
    156 char *MakeSDPMedia (const char *type, int dport, const char *protocol, 
    157                     unsigned pt, const char *rtpmap, const char *fmtpfmt, ...) 
     154char *vMakeSDPMedia (const char *type, int dport, const char *protocol, 
     155                    unsigned pt, const char *rtpmap, 
     156                    const char *fmtpfmt, va_list ap) 
    158157{ 
    159158    char *sdp_media = NULL; 
     
    177176    /* Format parameters */ 
    178177    char *fmtp = NULL; 
    179     if (fmtpfmt != NULL) 
    180     { 
    181         va_list ap; 
    182  
    183         va_start (ap, fmtpfmt); 
    184         if (vasprintf (&fmtp, fmtpfmt, ap) == -1) 
    185             fmtpfmt = NULL; 
    186         va_end (ap); 
    187  
    188         if (fmtp == NULL) 
    189             return NULL; 
    190     } 
     178    if ((fmtpfmt != NULL) 
     179     && (vasprintf (&fmtp, fmtpfmt, ap) == -1)) 
     180        return NULL; 
    191181 
    192182    char sdp_fmtp[fmtp ? (sizeof ("a=fmtp:123 *\r\n") + strlen (fmtp)) : 1]; 
  • src/stream_output/stream_output.h

    r60db872 r3ce5132  
    113113void announce_SAPHandlerDestroy( sap_handler_t *p_sap ); 
    114114 
     115#include <stdarg.h> 
     116 
    115117char *StartSDP (const char *name, const char *description, const char *url, 
    116118                const char *email, const char *phone, vlc_bool_t ssm, 
    117119                const struct sockaddr *orig, socklen_t origlen, 
    118120                const struct sockaddr *addr, socklen_t addrlen); 
     121char *vMakeSDPMedia (const char *type, int dport, const char *protocol, 
     122                     unsigned pt, const char *rtpmap, 
     123                     const char *fmtp, va_list ap); 
     124static inline 
    119125char *MakeSDPMedia (const char *type, int dport, const char *protocol, 
    120                     unsigned pt, const char *rtpmap, const char *fmtp, ...); 
    121  
     126                    unsigned pt, const char *rtpmap, const char *fmtpfmt, ...) 
     127
     128    va_list ap; 
     129    char *ret; 
     130    va_start (ap, fmtpfmt); 
     131    ret = vMakeSDPMedia (type, dport, protocol, pt, rtpmap, fmtpfmt, ap); 
     132    va_end (ap); 
     133    return ret; 
     134