Fix some regressions after refactoring pcm_params.c These mistakes don't allow snd_pcm_hw_param_set_near to establish correct value.
--- salsa-lib-a55ce0c348cd16e7853dae11e8e0e1b5a101d884/src/pcm_params.c +++ salsa-lib-a55ce0c348cd16e7853dae11e8e0e1b5a101d884-1/src/pcm_params.c @@ -590,11 +590,9 @@
save = *params; err = hw_param_set_max(params, var, *val, dir ? *dir : 0); - if (!err) { - err = hw_param_update_var(pcm, params, var, err); - if (!err) - return _snd_pcm_hw_param_get_max(params, var, val, dir); - } + err = hw_param_update_var(pcm, params, var, err); + if (!err) + return _snd_pcm_hw_param_get_max(params, var, val, dir); *params = save; return err; } @@ -683,7 +681,7 @@ snd_pcm_hw_params_t save = *params; int err = hw_param_set(params, var, val, dir); err = hw_param_update_var(pcm, params, var, err); - if (err) + if (err < 0) *params = save; return err; } @@ -712,7 +710,7 @@ save = *params; i->integer = 1; err = hw_param_update_var(pcm, params, var, 1); - if (err) + if (err < 0) *params = save; return err; } @@ -827,7 +825,7 @@ else if (valdir == 0) maxdir = -1; else { - valdir = 1; + maxdir = 1; max--; } save = *params;