aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/output_all.c8
-rw-r--r--src/output_all.h6
-rw-r--r--src/player_thread.c2
3 files changed, 16 insertions, 0 deletions
diff --git a/src/output_all.c b/src/output_all.c
index aee496e81..4b7701144 100644
--- a/src/output_all.c
+++ b/src/output_all.c
@@ -558,6 +558,14 @@ audio_output_all_close(void)
audio_output_all_elapsed_time = -1.0;
}
+void
+audio_output_all_song_border(void)
+{
+ /* clear the elapsed_time pointer at the beginning of a new
+ song */
+ audio_output_all_elapsed_time = 0.0;
+}
+
float
audio_output_all_get_elapsed_time(void)
{
diff --git a/src/output_all.h b/src/output_all.h
index 603cb30a2..8c3f1e80d 100644
--- a/src/output_all.h
+++ b/src/output_all.h
@@ -142,6 +142,12 @@ void
audio_output_all_cancel(void);
/**
+ * Indicate that a new song will begin now.
+ */
+void
+audio_output_all_song_border(void);
+
+/**
* Returns the "elapsed_time" stamp of the most recently finished
* chunk. A negative value is returned when no chunk has been
* finished yet.
diff --git a/src/player_thread.c b/src/player_thread.c
index 37b4ed5b4..3e234c4ff 100644
--- a/src/player_thread.c
+++ b/src/player_thread.c
@@ -736,6 +736,8 @@ player_song_border(struct player *player)
music_pipe_free(player->pipe);
player->pipe = player->dc->pipe;
+ audio_output_all_song_border();
+
if (!player_wait_for_decoder(player))
return false;