From a5e5e3cd3c85eafcced7a93b1cf37201560f2a28 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 1 Jun 2015 13:45:01 +0200 Subject: [PATCH] pcm: Don't assert in _snd_pcm_hw_params_internal() It's no fatal error from sw params, and it's really bad habit to use assert() and abort the operation as a system library. Signed-off-by: Takashi Iwai --- src/pcm/pcm_params.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pcm/pcm_params.c b/src/pcm/pcm_params.c index 1d667a58..60d99ad9 100644 --- a/src/pcm/pcm_params.c +++ b/src/pcm/pcm_params.c @@ -2361,7 +2361,8 @@ int _snd_pcm_hw_params_internal(snd_pcm_t *pcm, snd_pcm_hw_params_t *params) memset(&sw, 0, sizeof(sw)); snd_pcm_sw_params_default(pcm, &sw); err = snd_pcm_sw_params(pcm, &sw); - assert(err >= 0); + if (err < 0) + return err; if (pcm->mmap_rw || pcm->access == SND_PCM_ACCESS_MMAP_INTERLEAVED || -- 2.47.1