diff mbox series

pcm: hw: Do not return error unless there is one

Message ID 20221216082613.2439067-1-jonashg@axis.com
State New
Headers show
Series pcm: hw: Do not return error unless there is one | expand

Commit Message

Jonas Holmberg Dec. 16, 2022, 8:26 a.m. UTC
Add a line that was removed by mistake in commit
7f2d6c3aac3505ceee4b0d3e8b3ca423ce29b070.

Signed-off-by: Jonas Holmberg <jonashg@axis.com>
---
 src/pcm/pcm_hw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jonas Holmberg Dec. 20, 2022, 11:13 a.m. UTC | #1
On 2022-12-16 09:26, Jonas Holmberg wrote:
> Add a line that was removed by mistake in commit
> 7f2d6c3aac3505ceee4b0d3e8b3ca423ce29b070.

Note that this is a regression in rate-handling in hw_refine since 
v1.2.6.1, which for example breaks a hw pcm with rate set in config 
slaved to dmix.

BR
Jonas

> 
> Signed-off-by: Jonas Holmberg <jonashg@axis.com>
> ---
>   src/pcm/pcm_hw.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c
> index 0588ce5e..daa3e1ff 100644
> --- a/src/pcm/pcm_hw.c
> +++ b/src/pcm/pcm_hw.c
> @@ -356,7 +356,7 @@ static int snd_pcm_hw_hw_refine(snd_pcm_t *pcm, 
> snd_pcm_hw_params_t *params)
>           if (hw->rates.min > 0) {
>                   err = _snd_pcm_hw_param_set_minmax(params, 
> SND_PCM_HW_PARAM_RATE,
>                                                      hw->rates.min, 0, 
> hw->rates.max + 1, -1);
> -
> +               if (err < 0)
>                           return err;
>           }
> 
> -- 
> 2.37.4
>
diff mbox series

Patch

diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c
index 0588ce5e..daa3e1ff 100644
--- a/src/pcm/pcm_hw.c
+++ b/src/pcm/pcm_hw.c
@@ -356,7 +356,7 @@  static int snd_pcm_hw_hw_refine(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
 	if (hw->rates.min > 0) {
 		err = _snd_pcm_hw_param_set_minmax(params, SND_PCM_HW_PARAM_RATE,
 						   hw->rates.min, 0, hw->rates.max + 1, -1);
-
+		if (err < 0)
 			return err;
 	}