[MPlayer-cvslog] r36485 - trunk/libmpcodecs/ad_mpg123.c

reimar subversion at mplayerhq.hu
Fri Oct 25 21:59:57 CEST 2013


Author: reimar
Date: Fri Oct 25 21:59:57 2013
New Revision: 36485

Log:
Use sizeof(*var) instead of sizeof(type), prefer calloc.

Modified:
   trunk/libmpcodecs/ad_mpg123.c

Modified: trunk/libmpcodecs/ad_mpg123.c
==============================================================================
--- trunk/libmpcodecs/ad_mpg123.c	Fri Oct 25 21:59:56 2013	(r36484)
+++ trunk/libmpcodecs/ad_mpg123.c	Fri Oct 25 21:59:57 2013	(r36485)
@@ -84,8 +84,7 @@ static int preinit(sh_audio_t *sh)
     if (mpg123_init() != MPG123_OK)
         return 0;
 
-    sh->context = malloc(sizeof(struct ad_mpg123_context));
-    con = sh->context;
+    sh->context = con = calloc(sizeof(*con), 1);
     /* Auto-choice of optimized decoder (first argument NULL). */
     con->handle = mpg123_new(NULL, &err);
     if (!con->handle)


More information about the MPlayer-cvslog mailing list