All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pcm: simple: Fix asserts
@ 2015-11-11 15:11 Peter Rosin
  2015-11-11 15:21 ` Jaroslav Kysela
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Rosin @ 2015-11-11 15:11 UTC (permalink / raw)
  To: patch; +Cc: Peter Rosin, alsa-devel, Peter Rosin

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(-)

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;
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] pcm: simple: Fix asserts
  2015-11-11 15:11 [PATCH] pcm: simple: Fix asserts Peter Rosin
@ 2015-11-11 15:21 ` Jaroslav Kysela
  0 siblings, 0 replies; 4+ messages in thread
From: Jaroslav Kysela @ 2015-11-11 15:21 UTC (permalink / raw)
  To: Peter Rosin; +Cc: alsa-devel, Peter Rosin

Dne 11.11.2015 v 16:11 Peter Rosin napsal(a):
> From: Peter Rosin <peda@axentia.se>
> 
> Do not error out on the boundaries.

Applied. Thanks.


-- 
Jaroslav Kysela <perex@perex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] pcm: simple: Fix asserts
@ 2015-11-11 16:07 Peter Rosin
  2015-11-11 16:13 ` Peter Rosin
  0 siblings, 1 reply; 4+ messages in thread
From: Peter Rosin @ 2015-11-11 16:07 UTC (permalink / raw)
  To: patch; +Cc: Peter Rosin, alsa-devel, Peter Rosin

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(-)

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;
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] pcm: simple: Fix asserts
  2015-11-11 16:07 Peter Rosin
@ 2015-11-11 16:13 ` Peter Rosin
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Rosin @ 2015-11-11 16:13 UTC (permalink / raw)
  To: patch; +Cc: alsa-devel, Peter Rosin


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-11-11 16:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-11 15:11 [PATCH] pcm: simple: Fix asserts Peter Rosin
2015-11-11 15:21 ` Jaroslav Kysela
  -- strict thread matches above, loose matches on Subject: below --
2015-11-11 16:07 Peter Rosin
2015-11-11 16:13 ` Peter Rosin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.