aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2013-04-23 16:19:27 +0200
committerAnton Khirnov <anton@khirnov.net>2015-02-20 09:18:30 +0100
commita71d20c96adca437f15c6f0d4884d29f3344a441 (patch)
tree9f136d340c2db4965b1ea67b1c0229286f7f06ea
parent8d32d3ff66b859c913f2046f313b996d3ba34ce8 (diff)
decoder control: use av_mallocz instead of g_new
-rw-r--r--src/decoder/decoder_control.c14
1 files 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 <assert.h>
+#include <libavutil/mem.h>
+
#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)