aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)