changeset 36569:6ff73f13785c

demux_roq: Simplify code by using calloc. This also fixes the issue that total_audio_sample_count was never initialized.
author reimar
date Mon, 20 Jan 2014 22:08:34 +0000
parents 323fb622da7e
children e789b4c9007b
files libmpdemux/demux_roq.c
diffstat 1 files changed, 1 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_roq.c	Mon Jan 20 22:08:33 2014 +0000
+++ b/libmpdemux/demux_roq.c	Mon Jan 20 22:08:34 2014 +0000
@@ -108,7 +108,7 @@
   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 @@
   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);