aboutsummaryrefslogtreecommitdiffstats
path: root/src/output_all.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-03-09 19:25:26 +0100
committerMax Kellermann <max@duempel.org>2009-03-09 19:25:26 +0100
commit3291666b570b1d20f59db42936eaa37dbeb9ca65 (patch)
treec3905d60131c9f440d8ca7d7d1ec45cecce02d85 /src/output_all.h
parentab3d7c29dae44f39df28c85e26b108c44fdbc4bf (diff)
downloadmpd-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_all.h23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/output_all.h b/src/output_all.h
index 6f55809f3..deb33e0e4 100644
--- a/src/output_all.h
+++ b/src/output_all.h
@@ -29,7 +29,8 @@
#include <stddef.h>
struct audio_format;
-struct tag;
+struct music_buffer;
+struct music_chunk;
/**
* Global initialization: load audio outputs from the configuration
@@ -68,10 +69,13 @@ audio_output_find(const char *name);
*
* @param audio_format the preferred audio format, or NULL to reuse
* the previous format
+ * @param buffer the #music_buffer where consumed #music_chunk objects
+ * should be returned
* @return true on success, false on failure
*/
bool
-audio_output_all_open(const struct audio_format *audio_format);
+audio_output_all_open(const struct audio_format *audio_format,
+ struct music_buffer *buffer);
/**
* Closes all audio outputs.
@@ -80,19 +84,24 @@ void
audio_output_all_close(void);
/**
- * Play a chunk of audio data.
+ * Enqueue a #music_chunk object for playing, i.e. pushes it to a
+ * #music_pipe.
*
+ * @param chunk the #music_chunk object to be played
* @return true on success, false if no audio output was able to play
* (all closed then)
*/
bool
-audio_output_all_play(const char *data, size_t size);
+audio_output_all_play(struct music_chunk *chunk);
/**
- * Send metadata for the next chunk.
+ * Checks if the output devices have drained their music pipe, and
+ * returns the consumed music chunks to the #music_buffer.
+ *
+ * @return the number of chunks to play left in the #music_pipe
*/
-void
-audio_output_all_tag(const struct tag *tag);
+unsigned
+audio_output_all_check(void);
/**
* Puts all audio outputs into pause mode. Most implementations will