alsa: determine buffer_time if not already known
This patch fixes a theoretical (but practically impossible) flaw: the variable "buffer_time" may be uninitialized when it is used. Initialize the variable with snd_pcm_hw_params_get_buffer_time().
This commit is contained in:
parent
554a34fb95
commit
ab656a52da
@ -309,6 +309,11 @@ configure_hw:
|
|||||||
&buffer_time, NULL);
|
&buffer_time, NULL);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
} else {
|
||||||
|
err = snd_pcm_hw_params_get_buffer_time(hwparams, &buffer_time,
|
||||||
|
NULL);
|
||||||
|
if (err < 0)
|
||||||
|
buffer_time = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (period_time_ro == 0 && buffer_time >= 10000) {
|
if (period_time_ro == 0 && buffer_time >= 10000) {
|
||||||
|
Loading…
Reference in New Issue
Block a user