When two samples have matching times, step to the second one;
otherwise, we'll get stuck forever.
Signed-off-by: Keith Packard <keithp@keithp.com>
j = 0;
for (i = 0; i < pd->num; i++) {
t = start_time + i * pd->step;
j = 0;
for (i = 0; i < pd->num; i++) {
t = start_time + i * pd->step;
- while (j < td->num - 1 && fabs(t - td->data[j].time) > fabs(t - td->data[j+1].time))
+ while (j < td->num - 1 && fabs(t - td->data[j].time) >= fabs(t - td->data[j+1].time))
j++;
pd->data[i] = td->data[j].value;
}
j++;
pd->data[i] = td->data[j].value;
}