diff mbox

pcm: simple: Fix asserts

Message ID 1447258052-32203-1-git-send-email-peda@lysator.liu.se (mailing list archive)
State New, archived
Headers show

Commit Message

Peter Rosin Nov. 11, 2015, 4:07 p.m. UTC
From: Peter Rosin <peda@axentia.se>

Do not error out on the boundaries.

Signed-off-by: Peter Rosin <peda@axentia.se>
---
 src/pcm/pcm_simple.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Peter Rosin Nov. 11, 2015, 4:13 p.m. UTC | #1
On 2015-11-11 17:07, Peter Rosin wrote:
> From: Peter Rosin <peda@axentia.se>
>
> Do not error out on the boundaries.
>


Crap, sorry about the dup.

Cheers,
Peter
diff mbox

Patch

diff --git a/src/pcm/pcm_simple.c b/src/pcm/pcm_simple.c
index f943ec0..ce11083 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;