- /* If this matches the selected rate, we're happy */
- if (arb_sampling_rate == sr)
+ /*
+ * If this matches the selected rate, we're happy.
+ * Have some tolerance to counter rounding errors and
+ * avoid needless jumps to higher rates.
+ */
+ if (fabs(arb_sampling_rate - sr) <= 0.001) {
+ arb_sampling_rate = sr;