basetextoverlay: Correctly handle empty text buffers

This commit is contained in:
Sebastian Dröge 2012-09-27 12:40:51 +02:00
parent dc2f2c9a40
commit c4fb8d1e69

View file

@ -2210,6 +2210,7 @@ wait_for_text_buf:
in_text = (gchar *) map.data;
in_size = map.size;
if (in_size > 0) {
/* g_markup_escape_text() absolutely requires valid UTF8 input, it
* might crash otherwise. We don't fall back on GST_SUBTITLE_ENCODING
* here on purpose, this is something that needs fixing upstream */
@ -2244,6 +2245,10 @@ wait_for_text_buf:
}
if (in_text != (gchar *) map.data)
g_free (in_text);
} else {
GST_DEBUG_OBJECT (overlay, "No text to render (empty buffer)");
gst_base_text_overlay_render_text (overlay, " ", 1);
}
gst_buffer_unmap (overlay->text_buffer, &map);