[vlc-commits] opensles: use calloc

Rafaël Carré git at videolan.org
Wed Jan 18 23:51:25 CET 2012


vlc/vlc-1.2 | branch: master | Rafaël Carré <funman at videolan.org> | Tue Jan 17 22:27:39 2012 -0500| [6879512a816c9b04577b7b3c45218b0dce4af990] | committer: Jean-Baptiste Kempf

opensles: use calloc
(cherry picked from commit 4a9ecabe2c03c2918a30913aab1ab3d67ceabf5a)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 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