Use a recursive mutex so that a single thread can lock
authorgb <gb@5584edef-b1fe-4b99-b61b-dd2bab72e969>
Mon, 26 Apr 2010 08:40:27 +0000 (08:40 +0000)
committerGwenole Beauchesne <gbeauchesne@splitted-desktop.com>
Mon, 20 Sep 2010 10:55:32 +0000 (12:55 +0200)
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
gst-libs/gst/vaapi/gstvaapidisplay_priv.h

index bb4694e..d002b53 100644 (file)
@@ -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);
 }
 
 /**
index 2427bab..308da87 100644 (file)
@@ -69,7 +69,7 @@ G_BEGIN_DECLS
  * Base class for VA displays.
  */
 struct _GstVaapiDisplayPrivate {
-    GStaticMutex        mutex;
+    GStaticRecMutex     mutex;
     VADisplay           display;
     guint               width;
     guint               height;