rtpoll: Separate out before/after/work callback userdata

It is possible that we might want to have a separate userdata to be used
for these callbacks, so let's split them out.

This is particularly needed when using an pa_rtpoll_item around pa_fdsem
since that uses its own before/after callback but will essentially have
whatever is using the fdsem set up the work callback appropriately (and
thus at least the work callback's userdata needs to be separated from
the before/after callback -- we might as well then just separate all
three).

Signed-off-by: Arun Raghavan <arun@arunraghavan.net>
This commit is contained in:
Arun Raghavan 2016-05-12 18:05:14 +05:30
parent d15291bbbb
commit eb912d3605
5 changed files with 43 additions and 49 deletions

View file

@ -467,7 +467,7 @@ static int rtpoll_work_cb(pa_rtpoll_item *i) {
unsigned short revents = 0;
int err, ret = 0;
pd = pa_rtpoll_item_get_userdata(i);
pd = pa_rtpoll_item_get_work_userdata(i);
pa_assert_fp(pd);
pa_assert_fp(i == pd->poll_item);
@ -547,8 +547,7 @@ int pa_alsa_set_mixer_rtpoll(struct pa_alsa_mixer_pdata *pd, snd_mixer_t *mixer,
pd->poll_item = i;
pd->mixer = mixer;
pa_rtpoll_item_set_userdata(i, pd);
pa_rtpoll_item_set_work_callback(i, rtpoll_work_cb);
pa_rtpoll_item_set_work_callback(i, rtpoll_work_cb, pd);
return 0;
}