Commit d2ce4911 authored by Sebastian Dröge's avatar Sebastian Dröge

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

parent 72b142bf
...@@ -163,6 +163,7 @@ gst_clock_overlay_class_init (GstClockOverlayClass * klass) ...@@ -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) ...@@ -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);
} }
......
...@@ -123,6 +123,7 @@ gst_time_overlay_class_init (GstTimeOverlayClass * klass) ...@@ -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) ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment