[MPlayer-cvslog] r20078 - trunk/libmpdemux/demuxer.c

reimar subversion at mplayerhq.hu
Thu Oct 5 23:31:21 CEST 2006


Author: reimar
Date: Thu Oct  5 23:31:21 2006
New Revision: 20078

Modified:
   trunk/libmpdemux/demuxer.c

Log:
Simplify: replace malloc + memset 0 by calloc


Modified: trunk/libmpdemux/demuxer.c
==============================================================================
--- trunk/libmpdemux/demuxer.c	(original)
+++ trunk/libmpdemux/demuxer.c	Thu Oct  5 23:31:21 2006
@@ -213,8 +213,7 @@
     } else {
         sh_audio_t *sh;
         mp_msg(MSGT_DEMUXER,MSGL_V,MSGTR_FoundAudioStream,id);
-        demuxer->a_streams[id]=malloc(sizeof(sh_audio_t));
-        memset(demuxer->a_streams[id],0,sizeof(sh_audio_t));
+        demuxer->a_streams[id]=calloc(1, sizeof(sh_audio_t));
         sh = demuxer->a_streams[id];
         // set some defaults
         sh->samplesize=2;
@@ -246,8 +245,7 @@
         mp_msg(MSGT_DEMUXER,MSGL_WARN,MSGTR_VideoStreamRedefined,id);
     } else {
         mp_msg(MSGT_DEMUXER,MSGL_V,MSGTR_FoundVideoStream,id);
-        demuxer->v_streams[id]=malloc(sizeof(sh_video_t));
-        memset(demuxer->v_streams[id],0,sizeof(sh_video_t));
+        demuxer->v_streams[id]=calloc(1, sizeof(sh_video_t));
           mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VIDEO_ID=%d\n", vid);
     }
     ((sh_video_t *)demuxer->v_streams[id])->vid = vid;



More information about the MPlayer-cvslog mailing list