- divisor = powd->sample_rate * wn->min_iqs / numbytes;
- if (divisor)
- tv_divide(divisor, &tmp, &delay);
+ if (ret < 0 || !powd)
+ return sched_min_delay(s);
+ assert(powd->sample_rate > 0);
+ assert(wn->min_iqs > 0);
+ numbytes = powd->to->remaining * sizeof(short);
+ factor = numbytes / powd->sample_rate / wn->min_iqs;
+ tv_scale(factor, &tmp, &delay);