Logo Search packages:      
Sourcecode: pulseaudio version File versions

int pa_mainloop_poll ( pa_mainloop m  ) 

Execute the previously prepared poll. Returns a negative value on error.

Definition at line 842 of file mainloop.c.

                                     {
    pa_assert(m);
    pa_assert(m->state == STATE_PREPARED);

    if (m->quit)
        goto quit;

    m->state = STATE_POLLING;

    if (m->n_enabled_defer_events )
        m->poll_func_ret = 0;
    else {
        pa_assert(!m->rebuild_pollfds);

        if (m->poll_func)
            m->poll_func_ret = m->poll_func(m->pollfds, m->n_pollfds, m->prepared_timeout, m->poll_func_userdata);
        else
            m->poll_func_ret = poll(m->pollfds, m->n_pollfds, m->prepared_timeout);

        if (m->poll_func_ret < 0) {
            if (errno == EINTR)
                m->poll_func_ret = 0;
            else
                pa_log("poll(): %s", pa_cstrerror(errno));
        }
    }

    m->state = m->poll_func_ret < 0 ? STATE_PASSIVE : STATE_POLLED;
    return m->poll_func_ret;

quit:
    m->state = STATE_QUIT;
    return -2;
}


Generated by  Doxygen 1.6.0   Back to index