FreeCalypso > hg > themwi-rtp-lib
diff src/twjit.c @ 16:58e9719d1a84
twjit: add reset function
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 06 Jul 2024 22:00:06 +0000 |
parents | 355de6301404 |
children |
line wrap: on
line diff
--- a/src/twjit.c Sat Jul 06 21:31:16 2024 +0000 +++ b/src/twjit.c Sat Jul 06 22:00:06 2024 +0000 @@ -61,3 +61,14 @@ twjit->ts_units_per_sec = (uint32_t) clock_khz * 1000; twjit->ns_to_ts_units = 1000000 / clock_khz; } + +void twrtp_jibuf_reset(struct twrtp_jibuf_inst *twjit) +{ + msgb_queue_free(&twjit->sb[0].queue); + msgb_queue_free(&twjit->sb[1].queue); + twjit->state = TWJIT_STATE_EMPTY; + twjit->sb[0].depth = 0; + twjit->sb[1].depth = 0; + twjit->got_first_packet = false; + memset(&twjit->stats, 0, sizeof(struct twrtp_jibuf_stats)); +}