Changeset d58fbdad0e5332b948ccac1f796df27872959d45

Show
Ignore:
Timestamp:
22/04/08 16:10:52 (7 months ago)
Author:
Jean-Paul Saman <jean-paul.saman@m2x.nl>
git-committer:
Jean-Paul Saman <jean-paul.saman@m2x.nl> 1208873452 +0200
git-parent:

[afb9691c93dc4f1d59d15c661ac92f06aa634fe9]

git-author:
Jean-Paul Saman <jean-paul.saman@m2x.nl> 1208436773 +0200
Message:

Rework to use asprintf() in live555 demux

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/demux/live555.cpp

    r4dbeeda rd58fbda  
    458458    demux_sys_t *p_sys = p_demux->p_sys; 
    459459    Authenticator authenticator; 
    460     bool b_firstpass = true; 
    461  
     460    bool b_firstpass  = true; 
    462461    char *psz_user    = NULL; 
    463462    char *psz_pwd     = NULL; 
     
    467466    int  i_http_port  = 0; 
    468467    int  i_ret        = VLC_SUCCESS; 
    469  
    470     psz_url = (char*)malloc( strlen( p_sys->psz_path ) + 8 ); 
    471     if( !psz_url ) return VLC_ENOMEM; 
     468    int i_lefttries; 
    472469 
    473470    if( p_sys->url.i_port == 0 ) p_sys->url.i_port = 554; 
    474471    if( p_sys->url.psz_username || p_sys->url.psz_password ) 
    475472    { 
    476         sprintf( psz_url, "rtsp://%s:%d%s", p_sys->url.psz_host, 
    477                  p_sys->url.i_port, p_sys->url.psz_path ); 
     473        int err; 
     474        err = asprintf( &psz_url, "rtsp://%s:%d%s", p_sys->url.psz_host, 
     475                        p_sys->url.i_port, p_sys->url.psz_path ); 
     476        if( err == -1 ) return VLC_ENOMEM; 
    478477 
    479478        psz_user = strdup( p_sys->url.psz_username ); 
     
    482481    else 
    483482    { 
    484         sprintf( psz_url, "rtsp://%s", p_sys->psz_path ); 
     483        int err; 
     484        err = asprintf( &psz_url, "rtsp://%s", p_sys->psz_path ); 
     485        if( err == -1 ) return VLC_ENOMEM; 
    485486 
    486487        psz_user = var_CreateGetString( p_demux, "rtsp-user" ); 
     
    488489    } 
    489490 
    490     int i_lefttries = 3; 
     491    i_lefttries = 3; 
    491492createnew: 
    492493    i_lefttries--;