diff src/twjit.c @ 6:668b84c52094

twrtp_jibuf_create(): take quantum_ms & clock_khz arguments
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 05 Jul 2024 21:34:55 +0000
parents 1bb26347e253
children 95f6c8ce33b0
line wrap: on
line diff
--- a/src/twjit.c	Fri Jul 05 21:24:56 2024 +0000
+++ b/src/twjit.c	Fri Jul 05 21:34:55 2024 +0000
@@ -25,7 +25,7 @@
 /* create and destroy functions */
 
 struct twrtp_jibuf_inst *
-twrtp_jibuf_create(void *ctx, uint16_t quantum_ms, uint32_t quantum_ts_inc,
+twrtp_jibuf_create(void *ctx, uint16_t quantum_ms, uint16_t clock_khz,
 		   struct twrtp_jibuf_config *config)
 {
 	struct twrtp_jibuf_inst *twjit;
@@ -35,7 +35,7 @@
 		return NULL;
 
 	twjit->ext_config = config;
-	twjit->ts_quantum = quantum_ts_inc;
+	twjit->ts_quantum = (uint32_t)quantum_ms * clock_khz;
 	twjit->quanta_per_sec = 1000 / quantum_ms;
 	twjit->state = TWJIT_STATE_EMPTY;
 	INIT_LLIST_HEAD(&twjit->sb[0].queue);