[MPlayer-cvslog] r36665 - trunk/libmpdemux/demux_roq.c

reimar subversion at mplayerhq.hu
Mon Jan 20 23:08:34 CET 2014


Author: reimar
Date: Mon Jan 20 23:08:34 2014
New Revision: 36665

Log:
demux_roq: Simplify code by using calloc.

This also fixes the issue that total_audio_sample_count was never
initialized.

Modified:
   trunk/libmpdemux/demux_roq.c

Modified: trunk/libmpdemux/demux_roq.c
==============================================================================
--- trunk/libmpdemux/demux_roq.c	Mon Jan 20 23:08:33 2014	(r36664)
+++ trunk/libmpdemux/demux_roq.c	Mon Jan 20 23:08:34 2014	(r36665)
@@ -108,7 +108,7 @@ static demuxer_t* demux_open_roq(demuxer
   sh_video_t *sh_video = NULL;
   sh_audio_t *sh_audio = NULL;
 
-  roq_data_t *roq_data = malloc(sizeof(roq_data_t));
+  roq_data_t *roq_data = calloc(1, sizeof(*roq_data));
   int chunk_id;
   int chunk_size;
   int chunk_arg;
@@ -116,11 +116,6 @@ static demuxer_t* demux_open_roq(demuxer
   int largest_audio_chunk = 0;
   int fps;
 
-  roq_data->total_chunks = 0;
-  roq_data->current_chunk = 0;
-  roq_data->total_video_chunks = 0;
-  roq_data->chunks = NULL;
-
   // position the stream and start traversing
   stream_seek(demuxer->stream, 6);
   fps = stream_read_word_le(demuxer->stream);


More information about the MPlayer-cvslog mailing list