From f3c498c7f10dea395ee098a4d1d7e2f9602e2a99 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 13 Feb 2020 01:06:02 +0100 Subject: 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. --- audio/out/internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'audio/out/internal.h') diff --git a/audio/out/internal.h b/audio/out/internal.h index d1d7482ec1..7d1d744991 100644 --- a/audio/out/internal.h +++ b/audio/out/internal.h @@ -211,7 +211,7 @@ struct pollfd; int ao_wait_poll(struct ao *ao, struct pollfd *fds, int num_fds, pthread_mutex_t *lock); void ao_wakeup_poll(struct ao *ao); -void ao_underrun_event(struct ao *ao); +bool ao_underrun_event(struct ao *ao); bool ao_chmap_sel_adjust(struct ao *ao, const struct mp_chmap_sel *s, struct mp_chmap *map); -- cgit v1.2.3