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.
This commit is contained in:
gb 2010-04-26 08:40:27 +00:00 committed by Gwenole Beauchesne
parent edef951fb2
commit da3948bdeb
2 changed files with 4 additions and 4 deletions

View 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);
}
/**

View 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;