Logo Search packages:      
Sourcecode: pulseaudio version File versions

struct timeval* pa_timeval_sub ( struct timeval *  tv,
pa_usec_t  v 
) [read]

Subtract the specified time inmicroseconds to the specified timeval structure.

Since:
0.9.11

Definition at line 149 of file timeval.c.

                                                                {
    unsigned long secs;
    pa_assert(tv);

    secs = (unsigned long) (v/PA_USEC_PER_SEC);
    tv->tv_sec -= (time_t) secs;
    v -= ((pa_usec_t) secs) * PA_USEC_PER_SEC;

    if (tv->tv_usec >= (suseconds_t) v)
        tv->tv_usec -= (suseconds_t) v;
    else {
        tv->tv_sec --;
        tv->tv_usec += (suseconds_t) (PA_USEC_PER_SEC - v);
    }

    return tv;
}


Generated by  Doxygen 1.6.0   Back to index