Simplify: replace malloc + memset 0 by calloc

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20078 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2006-10-05 21:31:21 +00:00
parent 11e7ea9df4
commit fa92a6aad5
1 changed files with 2 additions and 4 deletions

View File

@ -213,8 +213,7 @@ sh_audio_t* new_sh_audio_aid(demuxer_t *demuxer,int id,int aid){
} 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 @@ sh_video_t* new_sh_video_vid(demuxer_t *demuxer,int id,int vid){
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;