[vlc-commits] live555: use calloc

Jean-Baptiste Kempf git at videolan.org
Fri Dec 28 18:44:54 CET 2012


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Dec 28 14:08:25 2012 +0100| [c52ba9162ecf4c3d24a32df89c5d6851c6104e39] | committer: Jean-Baptiste Kempf

live555: use calloc

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c52ba9162ecf4c3d24a32df89c5d6851c6104e39
---

 modules/demux/live555.cpp |   19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/modules/demux/live555.cpp b/modules/demux/live555.cpp
index a75b135..2d9246a 100644
--- a/modules/demux/live555.cpp
+++ b/modules/demux/live555.cpp
@@ -290,36 +290,19 @@ static int  Open ( vlc_object_t *p_this )
 
     p_demux->pf_demux  = Demux;
     p_demux->pf_control= Control;
-    p_demux->p_sys     = p_sys = (demux_sys_t*)malloc( sizeof( demux_sys_t ) );
+    p_demux->p_sys     = p_sys = (demux_sys_t*)calloc( 1, sizeof( demux_sys_t ) );
     if( !p_sys ) return VLC_ENOMEM;
 
     msg_Dbg( p_demux, "version "LIVEMEDIA_LIBRARY_VERSION_STRING );
 
-    p_sys->p_sdp = NULL;
-    p_sys->scheduler = NULL;
-    p_sys->env = NULL;
-    p_sys->ms = NULL;
-    p_sys->rtsp = NULL;
     TAB_INIT( p_sys->i_track, p_sys->track );
-    p_sys->i_pcr = 0;
     p_sys->f_npt = 0.;
     p_sys->f_npt_start = 0.;
     p_sys->f_npt_length = 0.;
-    p_sys->p_out_asf = NULL;
     p_sys->b_no_data = true;
-    p_sys->i_no_data_ti = 0;
-    p_sys->p_timeout = NULL;
-    p_sys->i_timeout = 0;
-    p_sys->b_timeout_call = false;
-    p_sys->b_multicast = false;
-    p_sys->b_real = false;
     p_sys->psz_path = strdup( p_demux->psz_location );
     p_sys->b_force_mcast = var_InheritBool( p_demux, "rtsp-mcast" );
-    p_sys->b_get_param = false;
-    p_sys->b_paused = false;
     p_sys->f_seek_request = -1;
-    p_sys->b_error = false;
-    p_sys->i_live555_ret = 0;
 
     /* parse URL for rtsp://[user:[passwd]@]serverip:port/options */
     vlc_UrlParse( &p_sys->url, p_sys->psz_path, 0 );



More information about the vlc-commits mailing list