aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder_control.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-08-09 20:55:18 +0200
committerMax Kellermann <max@duempel.org>2012-08-15 23:08:39 +0200
commiteb54337c40cbedc79177b48d2feaea9d12e95c0f (patch)
tree605176f21d8784541ea1965e4be7b7a2dcf6f4a3 /src/decoder_control.h
parent916a02017333ac32b8058d3c397eeb4ec85b742b (diff)
downloadmpd-eb54337c40cbedc79177b48d2feaea9d12e95c0f.tar.gz
mpd-eb54337c40cbedc79177b48d2feaea9d12e95c0f.tar.xz
mpd-eb54337c40cbedc79177b48d2feaea9d12e95c0f.zip
decoder_control: duplicate the song object
Make sure the decoder "owns" the song object, so nobody else can free it.
Diffstat (limited to 'src/decoder_control.h')
-rw-r--r--src/decoder_control.h8
1 files changed, 6 insertions, 2 deletions
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