diff options
author | Daniel Mack <daniel@caiaq.de> | 2009-09-14 16:25:35 +0800 |
---|---|---|
committer | Daniel Mack <daniel@caiaq.de> | 2009-09-14 16:25:35 +0800 |
commit | bebaa491650c48697b861ec5e76816e9af1a8803 (patch) | |
tree | b57d38476473f8fc6e282f8c39f730c936fa10d4 /src/pulse/mainloop.c | |
parent | c6d330ef91ce401660f907536b1bfd0591c14c2a (diff) | |
parent | 180ef1eebdfbdf0220af1fb5e4bf43e348207cde (diff) |
Merge branch 'master' of git://0pointer.de/pulseaudio
Diffstat (limited to 'src/pulse/mainloop.c')
-rw-r--r-- | src/pulse/mainloop.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/pulse/mainloop.c b/src/pulse/mainloop.c index c418d108..93a4742d 100644 --- a/src/pulse/mainloop.c +++ b/src/pulse/mainloop.c @@ -765,23 +765,22 @@ static pa_time_event* find_next_time_event(pa_mainloop *m) { static int calc_next_timeout(pa_mainloop *m) { pa_time_event *t; - pa_usec_t usec; + pa_usec_t clock_now; if (!m->n_enabled_time_events) return -1; - t = find_next_time_event(m); - pa_assert(t); + pa_assert_se(t = find_next_time_event(m)); - if (t->time == 0) + if (t->time <= 0) return 0; - usec = t->time - pa_rtclock_now(); + clock_now = pa_rtclock_now(); - if (usec <= 0) + if (t->time <= clock_now) return 0; - return (int) (usec / 1000); /* in milliseconds */ + return (int) ((t->time - clock_now) / 1000); /* in milliseconds */ } static int dispatch_timeout(pa_mainloop *m) { |