diff --git a/subprojects/gst-plugins-good/gst-libs/gst/glib-compat-private.h b/subprojects/gst-plugins-good/gst-libs/gst/glib-compat-private.h index 3d8885100c..93a55a45aa 100644 --- a/subprojects/gst-plugins-good/gst-libs/gst/glib-compat-private.h +++ b/subprojects/gst-plugins-good/gst-libs/gst/glib-compat-private.h @@ -78,6 +78,26 @@ gst_g_string_replace (GString *string, /* adaptations */ +#if !GLIB_CHECK_VERSION(2, 81, 1) +#define g_sort_array(a,n,s,f,udata) gst_g_sort_array(a,n,s,f,udata) + +// Don't need to maintain ABI compat here (n_elements), since we never pass +// the function as pointer but always call it directly ourselves. +static inline void +gst_g_sort_array (const void *array, + gssize n_elements, + size_t element_size, + GCompareDataFunc compare_func, + void *user_data) +{ + if (n_elements >= 0 && n_elements <= G_MAXINT) { + g_qsort_with_data (array, n_elements, element_size, compare_func, user_data); + } else { + g_abort (); + } +} +#endif + G_END_DECLS #endif diff --git a/subprojects/gst-plugins-good/gst/interleave/interleave.c b/subprojects/gst-plugins-good/gst/interleave/interleave.c index 91317dd8cc..1b5e633ab5 100644 --- a/subprojects/gst-plugins-good/gst/interleave/interleave.c +++ b/subprojects/gst-plugins-good/gst/interleave/interleave.c @@ -76,6 +76,8 @@ #include #include +#include "gst/glib-compat-private.h" + GST_DEBUG_CATEGORY_STATIC (gst_interleave_debug); #define GST_CAT_DEFAULT gst_interleave_debug @@ -299,7 +301,7 @@ gst_interleave_channel_positions_to_mask (GValueArray * positions, for (i = 0; i < channels; i++) { default_ordering_map[i] = i; } - g_qsort_with_data (default_ordering_map, channels, + g_sort_array (default_ordering_map, channels, sizeof (*default_ordering_map), compare_positions, pos); ret = gst_audio_channel_positions_to_mask (pos, channels, FALSE, mask); diff --git a/subprojects/gst-plugins-good/gst/interleave/meson.build b/subprojects/gst-plugins-good/gst/interleave/meson.build index cb96f0c173..d0930ea6a4 100644 --- a/subprojects/gst-plugins-good/gst/interleave/meson.build +++ b/subprojects/gst-plugins-good/gst/interleave/meson.build @@ -1,7 +1,7 @@ gstinterleave = library('gstinterleave', 'plugin.c', 'interleave.c', 'deinterleave.c', c_args : gst_plugins_good_args, - include_directories : [configinc], + include_directories : [configinc, libsinc], dependencies : [gstbase_dep, gstaudio_dep], install : true, install_dir : plugins_install_dir,