if (!g_strcmp0 (subs->str, ""))
g_string_append (subs, "\n");
- text = subs->str;
size = subs->len + 1;
- g_string_free (subs, FALSE);
+ text = g_string_free (subs, FALSE);
g_strfreev (lines);
} else {
size = page->columns * page->rows;
gchar **lines;
GString *subs;
guint start, stop, k;
+ gsize len;
gint i, j;
colors = (gchar **) g_malloc (sizeof (gchar *) * (rows + 1));
}
/* Allocate new buffer */
- *buf = gst_buffer_new_wrapped (subs->str, subs->len + 1);
+ len = subs->len + 1;
+ *buf = gst_buffer_new_wrapped (g_string_free (subs, FALSE), len);
g_strfreev (lines);
g_strfreev (colors);
- g_string_free (subs, FALSE);
return GST_FLOW_OK;
}
: "failed to retrieve system error message");
}
- *ret_error_str = message->str;
- g_string_free (message, FALSE);
+ *ret_error_str = g_string_free (message, FALSE);
}
}
gchar *
ks_options_flags_to_string (gulong flags)
{
- gchar *ret;
GString *str;
str = g_string_sized_new (128);
if (flags != 0)
g_string_append_printf (str, "|0x%08x", (guint) flags);
- ret = str->str;
- g_string_free (str, FALSE);
-
- return ret;
+ return g_string_free (str, FALSE);
}
typedef struct
if (verbose) g_print ("pipeline: %s\n", pipe_desc->str);
pipeline = (GstElement *) gst_parse_launch (pipe_desc->str, &error);
- g_string_free (pipe_desc, FALSE);
+ g_string_free (pipe_desc, TRUE);
if (error) {
g_print("pipeline parsing error: %s\n", error->message);
break;
}
}
- ret = markup->str;
- g_string_free (markup, FALSE);
+ ret = g_string_free (markup, FALSE);
GST_DEBUG ("parse_mdvdsub returning (%f+%f): %s",
state->start_time / (double) GST_SECOND,
state->duration / (double) GST_SECOND, ret);
}
g_value_init (dest, G_TYPE_STRING);
- g_value_take_string (dest, str->str);
- g_string_free (str, FALSE);
+ g_value_take_string (dest, g_string_free (str, FALSE));
}
static GstTagInfo *