[alsa-devel] [PATCH] salsa-lib: Fix mistakes after refactoring pcm_params.c
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;
At Sat, 16 Mar 2013 19:50:22 +0000, Mihail Zenkov wrote:
Fix some regressions after refactoring pcm_params.c These mistakes don't allow snd_pcm_hw_param_set_near to establish correct value.
Thanks, applied.
Please add me to Cc at the next time, so that I won't miss your post.
Takashi
--- 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)
*params = save; return err;return _snd_pcm_hw_param_get_max(params, var, val, dir);
} @@ -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;
max--; } save = *params;maxdir = 1;
Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
participants (2)
-
Mihail Zenkov
-
Takashi Iwai