diff options
Diffstat (limited to 'src/decoder_control.c')
-rw-r--r-- | src/decoder_control.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/decoder_control.c b/src/decoder_control.c index 8bf21365c..afcb16cdf 100644 --- a/src/decoder_control.c +++ b/src/decoder_control.c @@ -41,6 +41,8 @@ dc_new(GCond *client_cond) dc->state = DECODE_STATE_STOP; dc->command = DECODE_COMMAND_NONE; + dc->song = NULL; + dc->replay_gain_db = 0; dc->replay_gain_prev_db = 0; dc->mixramp_start = NULL; @@ -55,6 +57,9 @@ dc_free(struct decoder_control *dc) { dc_clear_error(dc); + if (dc->song != NULL) + song_free(dc->song); + g_cond_free(dc->cond); g_mutex_free(dc->mutex); g_free(dc->mixramp_start); @@ -129,6 +134,9 @@ dc_start(struct decoder_control *dc, struct song *song, assert(pipe != NULL); assert(music_pipe_empty(pipe)); + if (dc->song != NULL) + song_free(dc->song); + dc->song = song; dc->start_ms = start_ms; dc->end_ms = end_ms; |