diff --git a/daemon/main.c b/daemon/main.c index c108681aa..ef69edd4b 100644 --- a/daemon/main.c +++ b/daemon/main.c @@ -79,6 +79,7 @@ static GQueue rtpe_cli = G_QUEUE_INIT; GQueue rtpe_control_ng = G_QUEUE_INIT; GQueue rtpe_control_ng_tcp = G_QUEUE_INIT; struct bufferpool *shm_bufferpool; +struct bufferpool *rtpe_bufferpool; struct rtpengine_config rtpe_config = { // non-zero defaults @@ -1263,6 +1264,7 @@ RTPE_CONFIG_CHARPP_PARAMS static void early_init(void) { socket_init(); // needed for socktype_udp + rtpe_bufferpool = bufferpool_new(g_malloc, g_free, 64 * 65536); } #ifdef WITH_TRANSCODING @@ -1743,6 +1745,7 @@ int main(int argc, char **argv) { kernel_shutdown_table(); options_free(); bufferpool_cleanup(); + bufferpool_destroy(rtpe_bufferpool); return 0; } diff --git a/daemon/websocket.c b/daemon/websocket.c index 472ce1c1c..39709a435 100644 --- a/daemon/websocket.c +++ b/daemon/websocket.c @@ -230,6 +230,8 @@ static void websocket_message_push(struct websocket_conn *wc, websocket_message_ static void websocket_process(void *p, void *up) { + media_bufferpool = rtpe_bufferpool; + struct websocket_conn *wc = p; mutex_lock(&wc->lock); diff --git a/include/main.h b/include/main.h index c2c927824..f45adbdf3 100644 --- a/include/main.h +++ b/include/main.h @@ -316,6 +316,7 @@ extern GQueue rtpe_control_ng; extern GQueue rtpe_control_ng_tcp; extern struct bufferpool *shm_bufferpool; +extern struct bufferpool *rtpe_bufferpool; #endif diff --git a/t/test-stats.c b/t/test-stats.c index c0bdd26bf..5a302e4db 100644 --- a/t/test-stats.c +++ b/t/test-stats.c @@ -25,6 +25,7 @@ unsigned int rtpe_poller_rr_iter; GString *dtmf_logs; GQueue rtpe_control_ng = G_QUEUE_INIT; struct bufferpool *shm_bufferpool; +struct bufferpool *rtpe_bufferpool; static void __assert_g_string_eq(GString *a, const char *b, unsigned int line) { if (strcmp(a->str, b) == 0) { diff --git a/t/test-transcode.c b/t/test-transcode.c index cbb44fb08..a8c3f6382 100644 --- a/t/test-transcode.c +++ b/t/test-transcode.c @@ -20,6 +20,7 @@ unsigned int rtpe_poller_rr_iter; GString *dtmf_logs; GQueue rtpe_control_ng = G_QUEUE_INIT; struct bufferpool *shm_bufferpool; +struct bufferpool *rtpe_bufferpool; static str *sdup(char *s) { str r = STR(s);