From 6a76ce51c0b94a7ec65cc305f533b1a8801ca8e1 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Sat, 2 Feb 2002 09:47:19 +0000 Subject: [PATCH] Added limits for start_threshold --- aplay/aplay.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aplay/aplay.c b/aplay/aplay.c index 85e7aa6..8c48592 100644 --- a/aplay/aplay.c +++ b/aplay/aplay.c @@ -791,6 +791,10 @@ static void set_params(void) start_threshold = buffer_size + (double) rate * start_delay / 1000000; else start_threshold = (double) rate * start_delay / 1000000; + if (start_threshold < 1) + start_threshold = 1; + if (start_threshold > buffer_size) + start_threshold = buffer_size; err = snd_pcm_sw_params_set_start_threshold(handle, swparams, start_threshold); assert(err >= 0); if (stop_delay <= 0) -- 2.47.1