aboutsummaryrefslogtreecommitdiffstats
path: root/src/player_control.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-10-08 22:09:25 +0200
committerMax Kellermann <max@duempel.org>2009-10-08 22:09:25 +0200
commit448aefaace840ccd8b8c1fb82ff72ef986b84f12 (patch)
tree2433cdab57c247e96c5f2576b02bb9d6ac0cc022 /src/player_control.h
parent47b5e73a151f1ccc506f454eaafc5c65885ff0a3 (diff)
downloadmpd-448aefaace840ccd8b8c1fb82ff72ef986b84f12.tar.gz
mpd-448aefaace840ccd8b8c1fb82ff72ef986b84f12.tar.xz
mpd-448aefaace840ccd8b8c1fb82ff72ef986b84f12.zip
player_thread: get "elapsed" from audio outputs
Tracking the "elapsed" time from the chunks which we have sent to the output pipe is very imprecise: since we have implemented the music pipe, we're sending large number of chunks at once, giving the "elapsed" time stamp a resolution of usually more than a second. This patch changes the source of this information to the outputs. If a chunk has been played by all outputs, the "elapsed" time stamp is updated. The new command PLAYER_COMMAND_REFRESH makes the player thread update its status information: it tells the outputs to update the chunk time stamp. After that, player_control.elapsed_time is current.
Diffstat (limited to 'src/player_control.h')
-rw-r--r--src/player_control.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/player_control.h b/src/player_control.h
index 1acdb5686..e9a43e844 100644
--- a/src/player_control.h
+++ b/src/player_control.h
@@ -48,6 +48,12 @@ enum player_command {
* stop
*/
PLAYER_COMMAND_CANCEL,
+
+ /**
+ * Refresh status information in the #player_control struct,
+ * e.g. elapsed_time.
+ */
+ PLAYER_COMMAND_REFRESH,
};
enum player_error {