{time,clock}overlay: Hold the class-global pango mutex when changing the pango context

This commit is contained in:
Sebastian Dröge 2011-04-16 16:23:47 +02:00
parent 72b142bfdf
commit d2ce491153
2 changed files with 4 additions and 0 deletions

View file

@ -163,6 +163,7 @@ gst_clock_overlay_class_init (GstClockOverlayClass * klass)
"Format to use for time and date value, as in strftime.", "Format to use for time and date value, as in strftime.",
DEFAULT_PROP_TIMEFORMAT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); DEFAULT_PROP_TIMEFORMAT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_mutex_lock (GST_TEXT_OVERLAY_CLASS (klass)->pango_lock);
context = GST_TEXT_OVERLAY_CLASS (klass)->pango_context; context = GST_TEXT_OVERLAY_CLASS (klass)->pango_context;
pango_context_set_language (context, pango_language_from_string ("en_US")); pango_context_set_language (context, pango_language_from_string ("en_US"));
@ -177,6 +178,7 @@ gst_clock_overlay_class_init (GstClockOverlayClass * klass)
pango_font_description_set_size (font_description, 18 * PANGO_SCALE); pango_font_description_set_size (font_description, 18 * PANGO_SCALE);
pango_context_set_font_description (context, font_description); pango_context_set_font_description (context, font_description);
pango_font_description_free (font_description); pango_font_description_free (font_description);
g_mutex_unlock (GST_TEXT_OVERLAY_CLASS (klass)->pango_lock);
} }

View file

@ -123,6 +123,7 @@ gst_time_overlay_class_init (GstTimeOverlayClass * klass)
gsttextoverlay_class->get_text = gst_time_overlay_get_text; gsttextoverlay_class->get_text = gst_time_overlay_get_text;
g_mutex_lock (GST_TEXT_OVERLAY_CLASS (klass)->pango_lock);
context = GST_TEXT_OVERLAY_CLASS (klass)->pango_context; context = GST_TEXT_OVERLAY_CLASS (klass)->pango_context;
pango_context_set_language (context, pango_language_from_string ("en_US")); pango_context_set_language (context, pango_language_from_string ("en_US"));
@ -137,6 +138,7 @@ gst_time_overlay_class_init (GstTimeOverlayClass * klass)
pango_font_description_set_size (font_description, 18 * PANGO_SCALE); pango_font_description_set_size (font_description, 18 * PANGO_SCALE);
pango_context_set_font_description (context, font_description); pango_context_set_font_description (context, font_description);
pango_font_description_free (font_description); pango_font_description_free (font_description);
g_mutex_unlock (GST_TEXT_OVERLAY_CLASS (klass)->pango_lock);
} }
static void static void