Logo Search packages:      
Sourcecode: pulseaudio version File versions  Download package

int pa_mainloop_prepare ( pa_mainloop m,
int  timeout 
)

Prepare for a single iteration of the main loop. Returns a negative value on error or exit request. timeout specifies a maximum timeout for the subsequent poll, or -1 for blocking behaviour. .

Definition at line 811 of file mainloop.c.

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

    clear_wakeup(m);
    scan_dead(m);

    if (m->quit)
        goto quit;

    if (m->n_enabled_defer_events <= 0) {
        if (m->rebuild_pollfds)
            rebuild_pollfds(m);

        m->prepared_timeout = calc_next_timeout(m);
        if (timeout >= 0 && (timeout < m->prepared_timeout || m->prepared_timeout < 0))
            m->prepared_timeout = timeout;
    }

    m->state = STATE_PREPARED;
    return 0;

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


Generated by  Doxygen 1.6.0   Back to index