# HG changeset patch # User reimar # Date 1390255714 0 # Node ID 6ff73f13785c3ba05c4b4d65802093979a3d1450 # Parent 323fb622da7e749bccc4ba6179473b6e5516a525 demux_roq: Simplify code by using calloc. This also fixes the issue that total_audio_sample_count was never initialized. diff -r 323fb622da7e -r 6ff73f13785c libmpdemux/demux_roq.c --- 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);