Showing the changes to src (1 of 2 files). Show all
Unified · Split
| @@ -80,7 +80,7 @@ linear_vari_process (SRC_PRIVATE *psrc, SRC_DATA *data) · 79 unmodified lines | ||
| 80 | 80 | /* Calculate samples before first sample in input array. */ |
| 81 | 81 | while (input_index < 1.0 && priv->out_gen < priv->out_count) |
| 82 | 82 | { |
| 83 | − if (priv->in_used + priv->channels * input_index > priv->in_count) | |
| 83 | + if (priv->in_used + priv->channels * (1.0 + input_index) >= priv->in_count) | |
| 84 | 84 | break ; |
| 85 | 85 | |
| 86 | 86 | if (priv->out_count > 0 && fabs (psrc->last_ratio - data->src_ratio) > SRC_MIN_RATIO_DIFF) |
| @@ -101,7 +101,7 @@ linear_vari_process (SRC_PRIVATE *psrc, SRC_DATA *data) · 14 unmodified lines | ||
| 101 | 101 | input_index = rem ; |
| 102 | 102 | |
| 103 | 103 | /* Main processing loop. */ |
| 104 | − while (priv->out_gen < priv->out_count && priv->in_used + priv->channels * input_index <= priv->in_count) | |
| 104 | + while (priv->out_gen < priv->out_count && priv->in_used + priv->channels * input_index < priv->in_count) | |
| 105 | 105 | { |
| 106 | 106 | if (priv->out_count > 0 && fabs (psrc->last_ratio - data->src_ratio) > SRC_MIN_RATIO_DIFF) |
| 107 | 107 | src_ratio = psrc->last_ratio + priv->out_gen * (data->src_ratio - psrc->last_ratio) / priv->out_count ; |