summaryrefslogtreecommitdiffstats
path: root/audio/out/ao.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-11-09 09:58:44 +0100
committerwm4 <wm4@nowhere>2014-11-09 09:58:44 +0100
commitb021d038c2217903e511ca3673d5f2f1b996c4d4 (patch)
treeadc8258d5f8d18f11aa85f72fb6bc34ff62fb33f /audio/out/ao.h
parent7ee4e533693ee02e660ae0efb2e0e94db8c8c5af (diff)
downloadmpv-b021d038c2217903e511ca3673d5f2f1b996c4d4.tar.bz2
mpv-b021d038c2217903e511ca3673d5f2f1b996c4d4.tar.xz
audio/out: make ao_request_reload() idempotent
This is what you would expect. Before this commit, each ao_request_reload() call would just queue a reload command, and then recreate the AO for the number of times the function was called. Instead of sending a command, introduce some sort of event retrieval mechanism. At least for the reload case, use atomics, because we're too lazy to setup an extra mutex.
Diffstat (limited to 'audio/out/ao.h')
-rw-r--r--audio/out/ao.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/audio/out/ao.h b/audio/out/ao.h
index 3d811fe8d3..f1c922ae69 100644
--- a/audio/out/ao.h
+++ b/audio/out/ao.h
@@ -46,6 +46,10 @@ enum aocontrol {
// data might be written again, instead of closing the AO.
#define AOPLAY_FINAL_CHUNK 1
+enum {
+ AO_EVENT_RELOAD = 1,
+};
+
typedef struct ao_control_vol {
float left;
float right;
@@ -85,6 +89,8 @@ void ao_pause(struct ao *ao);
void ao_resume(struct ao *ao);
void ao_drain(struct ao *ao);
bool ao_eof_reached(struct ao *ao);
+int ao_query_and_reset_events(struct ao *ao, int events);
+void ao_request_reload(struct ao *ao);
struct ao_device_list *ao_get_device_list(struct mpv_global *global);
void ao_print_devices(struct mpv_global *global, struct mp_log *log);