fix default buffer time setting when maximum buffer time is less than 250 ms

This commit is contained in:
Clemens Ladisch 2004-05-03 10:03:57 +00:00
parent 25141facf0
commit 4b26b779a1

View file

@ -852,8 +852,13 @@ static void set_params(void)
} }
} }
rate = hwparams.rate; rate = hwparams.rate;
if (buffer_time == 0 && buffer_frames == 0) if (buffer_time == 0 && buffer_frames == 0) {
buffer_time = 500000; err = snd_pcm_hw_params_get_buffer_time_max(params,
&buffer_time, 0);
assert(err >= 0);
if (buffer_time > 500000)
buffer_time = 500000;
}
if (period_time == 0 && period_frames == 0) { if (period_time == 0 && period_frames == 0) {
if (buffer_time > 0) if (buffer_time > 0)
period_time = buffer_time / 4; period_time = buffer_time / 4;