spkmodem-decode: reset char if separator disappears

improves reliability in the case when audio cuts out,
mic glitches, laptop audio power saving, etc.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-13 01:47:40 +00:00
parent fe6da7a238
commit 3245333c53
+2 -1
View File
@@ -333,7 +333,8 @@ handle_audio(struct decoder_state *st)
* If the modem signal disappears for several (read: 3)
* frames, discard the partially assembled character.
*/
if (st->sample_count >= (3 * SAMPLES_PER_FRAME))
if (st->sample_count >= (3 * SAMPLES_PER_FRAME) ||
st->freq_separator <= 0)
reset_char(st);
st->sample_count = 0;