From 46e727ebdeaf1379b32cbf99e22bfa7788c37bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Wed, 5 Nov 2014 21:52:44 +0000 Subject: [PATCH] Revert "basetextoverlay: Fix segfault when overlay outside the frame" This is not correct. overlay->silent is a property and we should not just flip the property forever because one text we render is outside of the frame. The next one might not be, the positioning properties can be changed after all. The lower layers should handle clipping, and now do. This reverts commit 1cc311156cc3908d1d9888fbcda67305fc647337. https://bugzilla.gnome.org/show_bug.cgi?id=738984 https://bugzilla.gnome.org/show_bug.cgi?id=739281 --- ext/pango/gstbasetextoverlay.c | 60 +++++++++++++++------------------- 1 file changed, 26 insertions(+), 34 deletions(-) diff --git a/ext/pango/gstbasetextoverlay.c b/ext/pango/gstbasetextoverlay.c index 7d1f05e8c6..4327a2a27e 100644 --- a/ext/pango/gstbasetextoverlay.c +++ b/ext/pango/gstbasetextoverlay.c @@ -1378,42 +1378,34 @@ gst_base_text_overlay_get_pos (GstBaseTextOverlay * overlay, *xpos = 0; } *xpos += overlay->deltax; - if (*xpos > overlay->width) { - /* Clip text if out of frame */ - overlay->silent = TRUE; - } else { - if (overlay->use_vertical_render) - valign = GST_BASE_TEXT_OVERLAY_VALIGN_TOP; - else - valign = overlay->valign; - switch (valign) { - case GST_BASE_TEXT_OVERLAY_VALIGN_BOTTOM: - *ypos = overlay->height - height - overlay->ypad; - break; - case GST_BASE_TEXT_OVERLAY_VALIGN_BASELINE: - *ypos = overlay->height - (height + overlay->ypad); - break; - case GST_BASE_TEXT_OVERLAY_VALIGN_TOP: - *ypos = overlay->ypad; - break; - case GST_BASE_TEXT_OVERLAY_VALIGN_POS: - *ypos = (gint) (overlay->height * overlay->ypos) - height / 2; - *ypos = CLAMP (*ypos, 0, overlay->height - height); - break; - case GST_BASE_TEXT_OVERLAY_VALIGN_CENTER: - *ypos = (overlay->height - height) / 2; - break; - default: - *ypos = overlay->ypad; - break; - } - *ypos += overlay->deltay; - if (*ypos > overlay->height) { - /* Clip text if out of frame */ - overlay->silent = TRUE; - } + if (overlay->use_vertical_render) + valign = GST_BASE_TEXT_OVERLAY_VALIGN_TOP; + else + valign = overlay->valign; + + switch (valign) { + case GST_BASE_TEXT_OVERLAY_VALIGN_BOTTOM: + *ypos = overlay->height - height - overlay->ypad; + break; + case GST_BASE_TEXT_OVERLAY_VALIGN_BASELINE: + *ypos = overlay->height - (height + overlay->ypad); + break; + case GST_BASE_TEXT_OVERLAY_VALIGN_TOP: + *ypos = overlay->ypad; + break; + case GST_BASE_TEXT_OVERLAY_VALIGN_POS: + *ypos = (gint) (overlay->height * overlay->ypos) - height / 2; + *ypos = CLAMP (*ypos, 0, overlay->height - height); + break; + case GST_BASE_TEXT_OVERLAY_VALIGN_CENTER: + *ypos = (overlay->height - height) / 2; + break; + default: + *ypos = overlay->ypad; + break; } + *ypos += overlay->deltay; } static inline void