alsa: limit silence to threshold and available size

This commit is contained in:
Wim Taymans 2018-06-27 11:11:00 +02:00
parent d9e3eb49cc
commit 2fe392dd30

View file

@ -436,7 +436,7 @@ int spa_alsa_write(struct state *state, snd_pcm_uframes_t silence)
silence = 0;
}
if (written == 0)
silence = 4096;
silence = SPA_MIN(to_write, state->threshold);
if (silence > 0) {
snd_pcm_areas_silence(my_areas, offset, state->channels, silence, state->format);