]> git.alsa-project.org Git - alsa-utils.git/commitdiff
Added limits for start_threshold
authorJaroslav Kysela <perex@perex.cz>
Sat, 2 Feb 2002 09:47:19 +0000 (09:47 +0000)
committerJaroslav Kysela <perex@perex.cz>
Sat, 2 Feb 2002 09:47:19 +0000 (09:47 +0000)
aplay/aplay.c

index 85e7aa6234130d9130d87a4e4c93248e235730b2..8c48592379bb5767686bba8342ff01cf05cfed1b 100644 (file)
@@ -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)