From a71d20c96adca437f15c6f0d4884d29f3344a441 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Tue, 23 Apr 2013 16:19:27 +0200 Subject: decoder control: use av_mallocz instead of g_new --- src/decoder/decoder_control.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/decoder/decoder_control.c b/src/decoder/decoder_control.c index 17f7ced3..ec9b9791 100644 --- a/src/decoder/decoder_control.c +++ b/src/decoder/decoder_control.c @@ -23,14 +23,14 @@ #include +#include + #undef G_LOG_DOMAIN #define G_LOG_DOMAIN "decoder_control" struct decoder_control *dc_new(GCond *client_cond) { - struct decoder_control *dc = g_new(struct decoder_control, 1); - - dc->thread = NULL; + struct decoder_control *dc = av_mallocz(sizeof(*dc)); dc->mutex = g_mutex_new(); dc->cond = g_cond_new(); @@ -39,12 +39,6 @@ struct decoder_control *dc_new(GCond *client_cond) dc->state = DECODE_STATE_STOP; dc->command = DECODE_COMMAND_NONE; - dc->replay_gain_db = 0; - dc->replay_gain_prev_db = 0; - dc->mixramp_start = NULL; - dc->mixramp_end = NULL; - dc->mixramp_prev_end = NULL; - return dc; } @@ -55,7 +49,7 @@ void dc_free(struct decoder_control *dc) g_free(dc->mixramp_start); g_free(dc->mixramp_end); g_free(dc->mixramp_prev_end); - g_free(dc); + av_freep(&dc); } static void dc_command_wait_locked(struct decoder_control *dc) -- cgit v1.2.3