summaryrefslogtreecommitdiffstats
path: root/audio/out/ao.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-02-13 01:06:02 +0100
committerwm4 <wm4@nowhere>2020-02-13 01:28:14 +0100
commitf3c498c7f10dea395ee098a4d1d7e2f9602e2a99 (patch)
tree2c04214a859402d5a1018a12b0ec3022a466117c /audio/out/ao.h
parent7e6ea02183293dce4862f795d7e3d1080570f9c2 (diff)
downloadmpv-f3c498c7f10dea395ee098a4d1d7e2f9602e2a99.tar.bz2
mpv-f3c498c7f10dea395ee098a4d1d7e2f9602e2a99.tar.xz
ao: avoid unnecessary wakeups
If ao_add_events() is used, but all events flags are already set, then we don't need to wakeup the core again. Also, make the underrun message "exact" by avoiding the race condition mentioned in the comment. Avoiding redundant wakeups is not really worth the trouble, and it's actually just a bonus in the change making the ao_underrun_event() function return whether a new underrun was set, which is needed by the following commit.
Diffstat (limited to 'audio/out/ao.h')
-rw-r--r--audio/out/ao.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/audio/out/ao.h b/audio/out/ao.h
index f6b984ff30..eb9e29dacb 100644
--- a/audio/out/ao.h
+++ b/audio/out/ao.h
@@ -110,7 +110,7 @@ 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_add_events(struct ao *ao, int events);
+int ao_add_events(struct ao *ao, int events);
void ao_unblock(struct ao *ao);
void ao_request_reload(struct ao *ao);
void ao_hotplug_event(struct ao *ao);