diff --git a/daemon/call.c b/daemon/call.c index af74f88b8..49d046b1a 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -888,7 +888,7 @@ static int __wildcard_endpoint_map(struct call_media *media, unsigned int num_po } static void __rtp_stats_free(void *p) { - g_slice_free1(sizeof(struct rtp_stats), p); + bufferpool_unref(p); } struct packet_stream *__packet_stream_new(call_t *call) { @@ -1155,8 +1155,9 @@ void __rtp_stats_update(GHashTable *dst, struct codec_store *cs) { if (rs) continue; - rs = g_slice_alloc0(sizeof(*rs)); + rs = bufferpool_alloc0(shm_bufferpool, sizeof(*rs)); rs->payload_type = pt->payload_type; + rs->clock_rate = pt->clock_rate; g_hash_table_insert(dst, GINT_TO_POINTER(rs->payload_type), rs); } diff --git a/include/statistics.h b/include/statistics.h index c43e73d4b..caa44ab20 100644 --- a/include/statistics.h +++ b/include/statistics.h @@ -62,14 +62,6 @@ struct global_rate_min_max_avg { }; -struct rtp_stats { - unsigned int payload_type; - atomic64 packets; - atomic64 bytes; - atomic64 kernel_packets; - atomic64 kernel_bytes; -}; - struct codec_stats { char *chain; char *chain_brief; diff --git a/kernel-module/common_stats.h b/kernel-module/common_stats.h index 5d50b13d0..b2a009c63 100644 --- a/kernel-module/common_stats.h +++ b/kernel-module/common_stats.h @@ -46,4 +46,13 @@ struct stream_stats { atomic64 last_packet; }; +struct rtp_stats { + unsigned int payload_type; + uint32_t clock_rate; + atomic64 packets; + atomic64 bytes; + atomic64 kernel_packets; + atomic64 kernel_bytes; +}; + #endif