- Backport upstream fixes: fix bogus assert() in hw_params, a few PCM dmix/dshare/dsnoop fixes, enhacement of amixer, etc: 0017-test-pcm-Fix-generated-values-with-float-PCM-format.patch 0018-test-pcm_min-Fix-error-messages.patch 0019-pcm-Don-t-assert-in-_snd_pcm_hw_params_internal.patch 0020-pcm-Fix-snd_pcm_status-for-dmix-co.patch 0021-control-Allow-cset-ing-specific-values-in-the-multi-.patch 0022-PCM-snd_pcm_xxxx_drain-maybe-blocked-after-suspend-a.patch OBS-URL: https://build.opensuse.org/request/show/312533 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa?expand=0&rev=183
31 lines
961 B
Diff
31 lines
961 B
Diff
From a5e5e3cd3c85eafcced7a93b1cf37201560f2a28 Mon Sep 17 00:00:00 2001
|
|
From: Takashi Iwai <tiwai@suse.de>
|
|
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 <tiwai@suse.de>
|
|
---
|
|
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 1d667a583151..60d99ad96167 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.4.3
|
|
|