aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-11-02 17:10:26 +0100
committerMax Kellermann <max@duempel.org>2008-11-02 17:10:26 +0100
commit7e7704e42b0be6ffd632b84f34fae268f8cb0bb5 (patch)
tree61f9dc470dc19d9cabb05066da93efa84c82b1ef
parentaccc82cd6c20d732853d3d0d21c235005f36d03b (diff)
downloadmpd-7e7704e42b0be6ffd632b84f34fae268f8cb0bb5.tar.gz
mpd-7e7704e42b0be6ffd632b84f34fae268f8cb0bb5.tar.xz
mpd-7e7704e42b0be6ffd632b84f34fae268f8cb0bb5.zip
player: added player.song
Always remember which song is currently being sent to the audio device.
-rw-r--r--src/player_thread.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/player_thread.c b/src/player_thread.c
index 75badbb56..36a738149 100644
--- a/src/player_thread.c
+++ b/src/player_thread.c
@@ -57,6 +57,11 @@ struct player {
bool queued;
/**
+ * the song currently being played
+ */
+ struct song *song;
+
+ /**
* is cross fading enabled?
*/
enum xfade_state xfade;
@@ -99,6 +104,7 @@ static int waitOnDecode(struct player *player)
pc.bitRate = 0;
audio_format_clear(&pc.audio_format);
+ player->song = pc.next_song;
pc.next_song = NULL;
player->queued = false;
player->decoder_starting = true;
@@ -233,6 +239,7 @@ static void do_play(void)
.decoder_starting = false,
.paused = false,
.queued = false,
+ .song = NULL,
.xfade = XFADE_UNKNOWN,
.next_song_chunk = -1,
};