aboutsummaryrefslogtreecommitdiffstats
path: root/src/player_control.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-08-09 22:19:39 +0200
committerMax Kellermann <max@duempel.org>2012-08-15 23:09:22 +0200
commite96779de48be1f1b0080a8e1cfa89756c40e562d (patch)
tree58a329d5e1719733019cef09bbbc6f6c0ae8f579 /src/player_control.h
parenteb54337c40cbedc79177b48d2feaea9d12e95c0f (diff)
downloadmpd-e96779de48be1f1b0080a8e1cfa89756c40e562d.tar.gz
mpd-e96779de48be1f1b0080a8e1cfa89756c40e562d.tar.xz
mpd-e96779de48be1f1b0080a8e1cfa89756c40e562d.zip
player_control: duplicate the song object
Make sure the player "owns" the next_song object, so nobody else can free it.
Diffstat (limited to 'src/player_control.h')
-rw-r--r--src/player_control.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/player_control.h b/src/player_control.h
index 8be6c4694..c16dbcb9f 100644
--- a/src/player_control.h
+++ b/src/player_control.h
@@ -123,7 +123,15 @@ struct player_control {
struct audio_format audio_format;
float total_time;
float elapsed_time;
+
+ /**
+ * The next queued song.
+ *
+ * This is a duplicate, and must be freed when this attribute
+ * is cleared.
+ */
struct song *next_song;
+
double seek_where;
float cross_fade_seconds;
float mixramp_db;
@@ -198,6 +206,10 @@ player_lock_signal(struct player_control *pc)
player_unlock(pc);
}
+/**
+ * @param song the song to be queued; the given instance will be owned
+ * and freed by the player
+ */
void
pc_play(struct player_control *pc, struct song *song);
@@ -261,12 +273,18 @@ pc_stop(struct player_control *pc);
void
pc_update_audio(struct player_control *pc);
+/**
+ * @param song the song to be queued; the given instance will be owned
+ * and freed by the player
+ */
void
pc_enqueue_song(struct player_control *pc, struct song *song);
/**
* Makes the player thread seek the specified song to a position.
*
+ * @param song the song to be queued; the given instance will be owned
+ * and freed by the player
* @return true on success, false on failure (e.g. if MPD isn't
* playing currently)
*/