From da3948bdebf3b9eceb0df6a6b16a08f20f10f186 Mon Sep 17 00:00:00 2001 From: gb Date: Mon, 26 Apr 2010 08:40:27 +0000 Subject: [PATCH] Use a recursive mutex so that a single thread can lock several times. This fixes decoding of MPEG-2 and H.264 because those created a GstVaapiContext later through avcodec_decode_video() that was a protected call. --- gst-libs/gst/vaapi/gstvaapidisplay.c | 6 +++--- gst-libs/gst/vaapi/gstvaapidisplay_priv.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gst-libs/gst/vaapi/gstvaapidisplay.c b/gst-libs/gst/vaapi/gstvaapidisplay.c index bb4694e3ec..d002b53734 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay.c +++ b/gst-libs/gst/vaapi/gstvaapidisplay.c @@ -419,13 +419,13 @@ end: static void gst_vaapi_display_lock_default(GstVaapiDisplay *display) { - g_static_mutex_lock(&display->priv->mutex); + g_static_rec_mutex_lock(&display->priv->mutex); } static void gst_vaapi_display_unlock_default(GstVaapiDisplay *display) { - g_static_mutex_unlock(&display->priv->mutex); + g_static_rec_mutex_unlock(&display->priv->mutex); } static void @@ -562,7 +562,7 @@ gst_vaapi_display_init(GstVaapiDisplay *display) priv->subpicture_formats = NULL; priv->create_display = TRUE; - g_static_mutex_init(&priv->mutex); + g_static_rec_mutex_init(&priv->mutex); } /** diff --git a/gst-libs/gst/vaapi/gstvaapidisplay_priv.h b/gst-libs/gst/vaapi/gstvaapidisplay_priv.h index 2427babf1c..308da874f3 100644 --- a/gst-libs/gst/vaapi/gstvaapidisplay_priv.h +++ b/gst-libs/gst/vaapi/gstvaapidisplay_priv.h @@ -69,7 +69,7 @@ G_BEGIN_DECLS * Base class for VA displays. */ struct _GstVaapiDisplayPrivate { - GStaticMutex mutex; + GStaticRecMutex mutex; VADisplay display; guint width; guint height;