mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 22:36:33 +00:00
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 1cc311156c
.
https://bugzilla.gnome.org/show_bug.cgi?id=738984
https://bugzilla.gnome.org/show_bug.cgi?id=739281
This commit is contained in:
parent
a003423bc3
commit
46e727ebde
1 changed files with 26 additions and 34 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue