diff --git a/gst-libs/gst/vaapi/glibcompat.h b/gst-libs/gst/vaapi/glibcompat.h index 7df3ddfe67..7ccd645911 100644 --- a/gst-libs/gst/vaapi/glibcompat.h +++ b/gst-libs/gst/vaapi/glibcompat.h @@ -33,4 +33,26 @@ g_list_free_full(GList *list, GDestroyNotify free_func) } #endif +#if GLIB_CHECK_VERSION(2,31,2) +#define GStaticMutex GMutex +#undef g_static_mutex_init +#define g_static_mutex_init(mutex) g_mutex_init(mutex) +#undef g_static_mutex_free +#define g_static_mutex_free(mutex) g_mutex_clear(mutex) +#undef g_static_mutex_lock +#define g_static_mutex_lock(mutex) g_mutex_lock(mutex) +#undef g_static_mutex_unlock +#define g_static_mutex_unlock(mutex) g_mutex_unlock(mutex) + +#define GStaticRecMutex GRecMutex +#undef g_static_rec_mutex_init +#define g_static_rec_mutex_init(mutex) g_rec_mutex_init(mutex) +#undef g_static_rec_mutex_free +#define g_static_rec_mutex_free(mutex) g_rec_mutex_clear(mutex) +#undef g_static_rec_mutex_lock +#define g_static_rec_mutex_lock(mutex) g_rec_mutex_lock(mutex) +#undef g_static_rec_mutex_unlock +#define g_static_rec_mutex_unlock(m) g_rec_mutex_unlock(m) +#endif + #endif /* GLIB_COMPAT_H */ diff --git a/gst-libs/gst/vaapi/gstvaapidisplay.c b/gst-libs/gst/vaapi/gstvaapidisplay.c index cd7c0e223a..01e19fcd3d 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay.c +++ b/gst-libs/gst/vaapi/gstvaapidisplay.c @@ -361,6 +361,7 @@ gst_vaapi_display_destroy(GstVaapiDisplay *display) gst_vaapi_display_cache_remove(get_display_cache(), display); free_display_cache(); } + g_static_rec_mutex_free(&priv->mutex); } static gboolean diff --git a/gst-libs/gst/vaapi/gstvaapidisplaycache.c b/gst-libs/gst/vaapi/gstvaapidisplaycache.c index 54f349cc50..93178f4633 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplaycache.c +++ b/gst-libs/gst/vaapi/gstvaapidisplaycache.c @@ -169,6 +169,7 @@ gst_vaapi_display_cache_free(GstVaapiDisplayCache *cache) g_list_free(cache->list); cache->list = NULL; } + g_static_mutex_free(&cache->mutex); g_slice_free(GstVaapiDisplayCache, cache); }