mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 00:36:51 +00:00
ges-xml-formatter: use g_ascii_dtostr() instead of messing with setlocale()
Libraries shouldn't use setlocale().
This commit is contained in:
parent
6d70b553ad
commit
73075e4637
1 changed files with 3 additions and 6 deletions
|
@ -825,9 +825,7 @@ _save_keyframes (GString * str, GESTrackElement * trackelement, gint index)
|
|||
if (GST_IS_INTERPOLATION_CONTROL_SOURCE (source)) {
|
||||
GList *timed_values, *tmp;
|
||||
GstInterpolationMode mode;
|
||||
gchar *oldlocale = setlocale (LC_NUMERIC, NULL);
|
||||
|
||||
oldlocale = g_strdup (oldlocale);
|
||||
append_escaped (str,
|
||||
g_markup_printf_escaped
|
||||
(" <binding type='direct' source_type='interpolation' property='%s'",
|
||||
|
@ -839,16 +837,15 @@ _save_keyframes (GString * str, GESTrackElement * trackelement, gint index)
|
|||
timed_values =
|
||||
gst_timed_value_control_source_get_all
|
||||
(GST_TIMED_VALUE_CONTROL_SOURCE (source));
|
||||
setlocale (LC_NUMERIC, "C");
|
||||
for (tmp = timed_values; tmp; tmp = tmp->next) {
|
||||
gchar strbuf[G_ASCII_DTOSTR_BUF_SIZE];
|
||||
GstTimedValue *value;
|
||||
|
||||
value = (GstTimedValue *) tmp->data;
|
||||
append_escaped (str, g_markup_printf_escaped (" %" G_GUINT64_FORMAT
|
||||
":%f ", value->timestamp, value->value));
|
||||
":%s ", value->timestamp, g_ascii_dtostr (strbuf,
|
||||
G_ASCII_DTOSTR_BUF_SIZE, value->value)));
|
||||
}
|
||||
setlocale (LC_NUMERIC, oldlocale);
|
||||
g_free (oldlocale);
|
||||
append_escaped (str, g_markup_printf_escaped ("'/>\n"));
|
||||
} else
|
||||
GST_DEBUG ("control source not in [interpolation]");
|
||||
|
|
Loading…
Reference in a new issue