pango: 3rd time's the charm. Fix attribute list handling.

Really really fix attribute list handling by taking a
copy of the original attributes that pango_attr_list_filter
can mutate, but keep the original around intact to restore
later.
This commit is contained in:
Jan Schmidt 2013-02-08 00:05:24 +11:00
parent bc42d382e2
commit fb102419c7

View file

@ -1339,13 +1339,18 @@ gst_base_text_overlay_render_pangocairo (GstBaseTextOverlay * overlay,
/* draw shadow text */
{
PangoAttrList *origin_attr, *filtered_attr;
PangoAttrList *origin_attr, *filtered_attr, *temp_attr;
/* Store a ref on the original attributes for later restoration */
origin_attr =
pango_attr_list_copy (pango_layout_get_attributes (overlay->layout));
pango_attr_list_ref (pango_layout_get_attributes (overlay->layout));
/* Take a copy of the original attributes, because pango_attr_list_filter
* modifies the passed list */
temp_attr = pango_attr_list_copy (origin_attr);
filtered_attr =
pango_attr_list_filter (origin_attr,
pango_attr_list_filter (temp_attr,
gst_text_overlay_filter_foreground_attr, NULL);
pango_attr_list_unref (temp_attr);
cairo_save (cr);
cairo_translate (cr, overlay->shadow_offset, overlay->shadow_offset);