diff options
author | Max Kellermann <max@duempel.org> | 2009-03-09 19:25:26 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-03-09 19:25:26 +0100 |
commit | 3291666b570b1d20f59db42936eaa37dbeb9ca65 (patch) | |
tree | c3905d60131c9f440d8ca7d7d1ec45cecce02d85 /src/output_internal.h | |
parent | ab3d7c29dae44f39df28c85e26b108c44fdbc4bf (diff) | |
download | mpd-3291666b570b1d20f59db42936eaa37dbeb9ca65.tar.gz mpd-3291666b570b1d20f59db42936eaa37dbeb9ca65.tar.xz mpd-3291666b570b1d20f59db42936eaa37dbeb9ca65.zip |
output: play from a music_pipe object
Instead of passing individual buffers to audio_output_all_play(), pass
music_chunk objects. Append all those chunks asynchronously to a
music_pipe instance. All output threads may then read chunks from
this pipe. This reduces MPD's internal latency by an order of
magnitude.
Diffstat (limited to '')
-rw-r--r-- | src/output_internal.h | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/src/output_internal.h b/src/output_internal.h index 498f45d06..7e1ac9b7a 100644 --- a/src/output_internal.h +++ b/src/output_internal.h @@ -30,10 +30,8 @@ enum audio_output_command { AO_COMMAND_NONE = 0, AO_COMMAND_OPEN, AO_COMMAND_CLOSE, - AO_COMMAND_PLAY, AO_COMMAND_PAUSE, AO_COMMAND_CANCEL, - AO_COMMAND_SEND_TAG, AO_COMMAND_KILL }; @@ -110,16 +108,27 @@ struct audio_output { enum audio_output_command command; /** - * Command arguments, depending on the command. + * The music pipe which provides music chunks to be played. */ - union { - struct { - const void *data; - size_t size; - } play; + const struct music_pipe *pipe; - const struct tag *tag; - } args; + /** + * This mutex protects #chunk and #chunk_finished. + */ + GMutex *mutex; + + /** + * The #music_chunk which is currently being played. All + * chunks before this one may be returned to the + * #music_buffer, because they are not going to be used by + * this output anymore. + */ + const struct music_chunk *chunk; + + /** + * Has the output finished playing #chunk? + */ + bool chunk_finished; }; /** |