From 448aefaace840ccd8b8c1fb82ff72ef986b84f12 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 8 Oct 2009 22:09:25 +0200 Subject: 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. --- src/output_all.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/output_all.h') diff --git a/src/output_all.h b/src/output_all.h index 2a09514b2..e124d3150 100644 --- a/src/output_all.h +++ b/src/output_all.h @@ -128,4 +128,11 @@ audio_output_all_pause(void); void audio_output_all_cancel(void); +/** + * Returns the "elapsed_time" stamp of the most recently finished + * chunk. + */ +float +audio_output_all_get_elapsed_time(void); + #endif -- cgit v1.2.3