From eb54337c40cbedc79177b48d2feaea9d12e95c0f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 9 Aug 2012 20:55:18 +0200 Subject: decoder_control: duplicate the song object Make sure the decoder "owns" the song object, so nobody else can free it. --- src/decoder_control.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/decoder_control.h') diff --git a/src/decoder_control.h b/src/decoder_control.h index 7305e5813..9ecbde73e 100644 --- a/src/decoder_control.h +++ b/src/decoder_control.h @@ -90,8 +90,11 @@ struct decoder_control { * The song currently being decoded. This attribute is set by * the player thread, when it sends the #DECODE_COMMAND_START * command. + * + * This is a duplicate, and must be freed when this attribute + * is cleared. */ - const struct song *song; + struct song *song; /** * The initial seek position (in milliseconds), e.g. to the @@ -303,7 +306,8 @@ decoder_lock_is_current_song(struct decoder_control *dc, * Start the decoder. * * @param the decoder - * @param song the song to be decoded + * @param song the song to be decoded; the given instance will be + * owned and freed by the decoder * @param start_ms see #decoder_control * @param end_ms see #decoder_control * @param pipe the pipe which receives the decoded chunks (owned by -- cgit v1.2.3