X-Git-Url: https://code.delx.au/pulseaudio/blobdiff_plain/63c1eb14d889fe052afad16dfc470802cc48bb4a..7ba22276d232270691dfb44328c6e794569a0c17:/src/pulsecore/hook-list.c diff --git a/src/pulsecore/hook-list.c b/src/pulsecore/hook-list.c index 0aac4759..d9b9917d 100644 --- a/src/pulsecore/hook-list.c +++ b/src/pulsecore/hook-list.c @@ -5,7 +5,7 @@ PulseAudio is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as - published by the Free Software Foundation; either version 2 of the + published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. PulseAudio is distributed in the hope that it will be useful, but @@ -44,7 +44,7 @@ static void slot_free(pa_hook *hook, pa_hook_slot *slot) { pa_xfree(slot); } -void pa_hook_free(pa_hook *hook) { +void pa_hook_done(pa_hook *hook) { pa_assert(hook); pa_assert(hook->n_firing == 0); @@ -97,7 +97,7 @@ pa_hook_result_t pa_hook_fire(pa_hook *hook, void *data) { hook->n_firing ++; - for (slot = hook->slots; slot; slot = slot->next) { + PA_LLIST_FOREACH(slot, hook->slots) { if (slot->dead) continue; @@ -121,3 +121,9 @@ pa_hook_result_t pa_hook_fire(pa_hook *hook, void *data) { return result; } + +pa_bool_t pa_hook_is_firing(pa_hook *hook) { + pa_assert(hook); + + return hook->n_firing > 0; +}