diff --git a/daemon/media_socket.c b/daemon/media_socket.c index 099058b10..470b42ffb 100644 --- a/daemon/media_socket.c +++ b/daemon/media_socket.c @@ -1507,10 +1507,10 @@ INLINE void __re_address_translate_ep(struct re_address *o, const endpoint_t *ep ep->address.family->endpoint2kernel(o, ep); } -static int __rtp_stats_pt_sort(const struct rtp_stats *a, const struct rtp_stats *b) { - if (a->payload_type < b->payload_type) +static int __rtp_stats_pt_sort(const struct rtp_stats **a, const struct rtp_stats **b) { + if ((*a)->payload_type < (*b)->payload_type) return -1; - if (a->payload_type > b->payload_type) + if ((*a)->payload_type > (*b)->payload_type) return 1; return 0; } diff --git a/lib/containers.h b/lib/containers.h index 237a50b53..3307b5c91 100644 --- a/lib/containers.h +++ b/lib/containers.h @@ -458,7 +458,7 @@ static inline void g_queue_clear_full(GQueue *q, GDestroyNotify free_func) { }) #define t_ptr_array_sort(A, f) ({ \ - int (*__f)(__typeof__((A)->__ct), __typeof__((A)->__ct)) = f; \ + int (*__f)(__typeof__(&(A)->__ct), __typeof__(&(A)->__ct)) = f; \ g_ptr_array_sort(&(A)->a, (GCompareFunc) __f); \ })