changeset 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 32cb5a2d1178
files include/twjit.h src/twjit.c
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/include/twjit.h	Fri Jul 05 21:24:56 2024 +0000
+++ b/include/twjit.h	Fri Jul 05 21:34:55 2024 +0000
@@ -109,7 +109,7 @@
 /* twjit module API functions */
 
 struct twrtp_jibuf_inst *twrtp_jibuf_create(void *ctx, uint16_t quantum_ms,
-					    uint32_t quantum_ts_inc,
+					    uint16_t clock_khz,
 					    struct twrtp_jibuf_config *config);
 
 void twrtp_jibuf_destroy(struct twrtp_jibuf_inst *twjit);
--- 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);