I just noticed that this line is wrong. Maybe it should be:
tracker->timeout += p->ts.tv_sec;