diff options
author | Max Kellermann <max@duempel.org> | 2008-09-24 07:20:26 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-09-24 07:20:26 +0200 |
commit | d32f49a90ba69525884ee6fe4f2055792aa10430 (patch) | |
tree | 2efa2310c8ccc8d49f5f3b856c8d15162dd5b251 /src/output_api.h | |
parent | 8f4ebf0caf8514fb7838eb27b848e5a4cccaae12 (diff) | |
download | mpd-d32f49a90ba69525884ee6fe4f2055792aa10430.tar.gz mpd-d32f49a90ba69525884ee6fe4f2055792aa10430.tar.xz mpd-d32f49a90ba69525884ee6fe4f2055792aa10430.zip |
output: one thread per audio output
To keep I/O nastiness and latencies away from the core, move the audio
output code to a separate thread, one per output. The thread is
created on demand, and currently runs until mpd exits.
Diffstat (limited to 'src/output_api.h')
-rw-r--r-- | src/output_api.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/output_api.h b/src/output_api.h index 887b57c7c..bea5c5b4c 100644 --- a/src/output_api.h +++ b/src/output_api.h @@ -26,6 +26,7 @@ #include "tag.h" #include "conf.h" #include "log.h" +#include "notify.h" #include "os_compat.h" #define DISABLED_AUDIO_OUTPUT_PLUGIN(plugin) const struct audio_output_plugin plugin; @@ -54,6 +55,16 @@ struct audio_output_plugin { const struct tag *tag); }; +enum audio_output_command { + AO_COMMAND_NONE = 0, + AO_COMMAND_OPEN, + AO_COMMAND_CLOSE, + AO_COMMAND_PLAY, + AO_COMMAND_CANCEL, + AO_COMMAND_SEND_TAG, + AO_COMMAND_KILL +}; + struct audio_output { int open; const char *name; @@ -67,7 +78,22 @@ struct audio_output { char *convBuffer; size_t convBufferLen; + pthread_t thread; + struct notify notify; + enum audio_output_command command; + union { + struct { + const char *data; + size_t size; + } play; + + const struct tag *tag; + } args; + int result; + void *data; }; +extern struct notify audio_output_client_notify; + #endif |