[vlc-commits] opensles: use calloc

Rafaël Carré git at videolan.org
Wed Jan 18 04:31:32 CET 2012


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Tue Jan 17 22:27:39 2012 -0500| [4a9ecabe2c03c2918a30913aab1ab3d67ceabf5a] | committer: Rafaël Carré

opensles: use calloc

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

 modules/audio_output/opensles_android.c |   12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/modules/audio_output/opensles_android.c b/modules/audio_output/opensles_android.c
index cd343cb..03eafbf 100644
--- a/modules/audio_output/opensles_android.c
+++ b/modules/audio_output/opensles_android.c
@@ -133,23 +133,17 @@ static void Clear( aout_sys_t *p_sys )
 /*****************************************************************************
  * Open: open a dummy audio device
  *****************************************************************************/
-static int Open( vlc_object_t * p_this )
+static int Open( vlc_object_t *p_this )
 {
     audio_output_t     *p_aout = (audio_output_t *)p_this;
     SLresult            result;
 
     /* Allocate structure */
-    p_aout->sys = malloc( sizeof( aout_sys_t ) );
+    p_aout->sys = calloc( 1, sizeof( aout_sys_t ) );
     if( unlikely( p_aout->sys == NULL ) )
         return VLC_ENOMEM;
 
-    aout_sys_t * p_sys = p_aout->sys;
-
-    p_sys->playerObject     = NULL;
-    p_sys->engineObject     = NULL;
-    p_sys->outputMixObject  = NULL;
-    p_sys->i_toclean_buffer = 0;
-    p_sys->i_toappend_buffer= 0;
+    aout_sys_t *p_sys = p_aout->sys;
 
     //Acquiring LibOpenSLES symbols :
     p_sys->p_so_handle = dlopen( "libOpenSLES.so", RTLD_NOW );



More information about the vlc-commits mailing list