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.
This commit is contained in:
Max Kellermann
2009-10-08 22:09:25 +02:00
parent 47b5e73a15
commit 448aefaace
5 changed files with 42 additions and 4 deletions
+2
View File
@@ -142,6 +142,8 @@ pc_set_pause(bool pause_flag)
void
pc_get_status(struct player_status *status)
{
player_command(PLAYER_COMMAND_REFRESH);
status->state = pc.state;
if (pc.state != PLAYER_STATE_STOP) {