mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-03 09:01:50 -05:00
add support for module search path as command line argument
protocol-native: move first data request into ack of stream creation improve mainloop API: return the number of dispatched sources on iterate() fix a resampling bug introduce network latency measurement WARNING: all these changes together may break some applications git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@189 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
0c99fb3182
commit
25123469d5
20 changed files with 210 additions and 60 deletions
52
polyp/util.c
52
polyp/util.c
|
|
@ -221,26 +221,52 @@ char *pa_get_host_name(char *s, size_t l) {
|
|||
return s;
|
||||
}
|
||||
|
||||
uint32_t pa_age(struct timeval *tv) {
|
||||
struct timeval now;
|
||||
uint32_t r;
|
||||
assert(tv);
|
||||
pa_usec_t pa_timeval_diff(const struct timeval *a, const struct timeval *b) {
|
||||
pa_usec_t r;
|
||||
assert(a && b);
|
||||
|
||||
if (tv->tv_sec == 0)
|
||||
return 0;
|
||||
if (pa_timeval_cmp(a, b) < 0) {
|
||||
const struct timeval *c;
|
||||
c = a;
|
||||
a = b;
|
||||
b = c;
|
||||
}
|
||||
|
||||
gettimeofday(&now, NULL);
|
||||
|
||||
r = (now.tv_sec-tv->tv_sec) * 1000000;
|
||||
r = (a->tv_sec - b->tv_sec)* 1000000;
|
||||
|
||||
if (now.tv_usec >= tv->tv_usec)
|
||||
r += now.tv_usec - tv->tv_usec;
|
||||
else
|
||||
r -= tv->tv_usec - now.tv_usec;
|
||||
if (a->tv_usec > b->tv_usec)
|
||||
r += (a->tv_usec - b->tv_usec);
|
||||
else if (a->tv_usec < b->tv_usec)
|
||||
r -= (b->tv_usec - a->tv_usec);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
int pa_timeval_cmp(const struct timeval *a, const struct timeval *b) {
|
||||
assert(a && b);
|
||||
|
||||
if (a->tv_sec < b->tv_sec)
|
||||
return -1;
|
||||
|
||||
if (a->tv_sec > b->tv_sec)
|
||||
return 1;
|
||||
|
||||
if (a->tv_usec < b->tv_usec)
|
||||
return -1;
|
||||
|
||||
if (a->tv_usec > b->tv_usec)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
pa_usec_t pa_age(const struct timeval *tv) {
|
||||
struct timeval now;
|
||||
assert(tv);
|
||||
gettimeofday(&now, NULL);
|
||||
return pa_timeval_diff(&now, tv);
|
||||
}
|
||||
|
||||
#define NICE_LEVEL (-15)
|
||||
|
||||
void pa_raise_priority(void) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue