mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
pulse: handle NULL timespec
This commit is contained in:
parent
1ceb902b76
commit
ec40702427
1 changed files with 2 additions and 2 deletions
|
|
@ -120,16 +120,16 @@ static void set_timer(pa_time_event *ev, const struct timeval *tv)
|
|||
{
|
||||
pa_mainloop *mainloop = ev->mainloop;
|
||||
struct timespec ts;
|
||||
struct timeval ttv = *tv;
|
||||
|
||||
if (tv == NULL) {
|
||||
ts.tv_sec = 0;
|
||||
ts.tv_nsec = 1;
|
||||
} else {
|
||||
struct timeval ttv = *tv;
|
||||
if ((tv->tv_usec & PA_TIMEVAL_RTCLOCK) == 0)
|
||||
pa_rtclock_from_wallclock(&ttv);
|
||||
ts.tv_sec = ttv.tv_sec;
|
||||
ts.tv_nsec = ttv.tv_usec * 1000LL;
|
||||
ts.tv_nsec = ttv.tv_usec * SPA_NSEC_PER_USEC;
|
||||
}
|
||||
pw_log_debug("set timer %p %ld %ld", ev, ts.tv_sec, ts.tv_nsec);
|
||||
pw_loop_update_timer(mainloop->loop, ev->source, &ts, NULL, true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue