alsa/0002-pcm-simple-Fix-asserts.patch
Ismail Dönmez 98d999615a Accepting request 357797 from home:tiwai:branches:multimedia:libs
- Backports from upstream: minor PCM fixes, topology API updates,
  and a few build cleanup:
  0002-pcm-simple-Fix-asserts.patch
  0003-topology-open-topology-files-with-O_TRUNC.patch
  0004-topology-Remove-unused-function-write_data_block.patch
  0005-topology-Remove-unused-variables.patch
  0006-topology-Fix-comparison-of-unsigned-expression-0.patch
  0007-topology-Not-compare-a-for-loop-iterator-with-ABI-__.patch
  0008-topology-Quit-and-show-error-message-on-big-endian-m.patch
  0009-config-files-do-not-include-ucm-topology-configurati.patch
  0010-control-add-missing-asserts-to-ctl_elem_set-function.patch
  0011-pcm_hw-fix-possible-memory-leak-coverity.patch
  0012-coverity-fixes.patch
  0013-topology-fix-debug-output-to-print-correct-max-value.patch

OBS-URL: https://build.opensuse.org/request/show/357797
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa?expand=0&rev=192
2016-02-05 07:31:48 +00:00

43 lines
1.2 KiB
Diff

From 57ae61ce274964c100f8df372f2d3b4c68ac17b8 Mon Sep 17 00:00:00 2001
From: Peter Rosin <peda@axentia.se>
Date: Wed, 11 Nov 2015 16:11:10 +0100
Subject: [PATCH] pcm: simple: Fix asserts
Do not error out on the boundaries.
Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
src/pcm/pcm_simple.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/pcm/pcm_simple.c b/src/pcm/pcm_simple.c
index f943ec09b396..ce110833922e 100644
--- a/src/pcm/pcm_simple.c
+++ b/src/pcm/pcm_simple.c
@@ -173,8 +173,8 @@ int snd_spcm_init(snd_pcm_t *pcm,
snd_pcm_sw_params_alloca(&sw_params);
assert(pcm);
- assert(rate > 5000 && rate < 192000);
- assert(channels > 1 && channels < 512);
+ assert(rate >= 5000 && rate <= 192000);
+ assert(channels >= 1 && channels <= 512);
rrate = rate;
err = set_buffer_time(latency, &buffer_time);
@@ -233,8 +233,8 @@ int snd_spcm_init_duplex(snd_pcm_t *playback_pcm,
assert(playback_pcm);
assert(capture_pcm);
- assert(rate > 5000 && rate < 192000);
- assert(channels > 1 && channels < 512);
+ assert(rate >= 5000 && rate <= 192000);
+ assert(channels >= 1 && channels <= 512);
pcms[0] = playback_pcm;
pcms[1] = capture_pcm;
--
2.7.0