From 5ab40ce5cb345e9207caaa9dc709e2bb30cf7128 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Sun, 21 Apr 2013 21:11:52 -0300 Subject: [PATCH] ges: Fix compilation with clang --- ges/ges-timeline.c | 3 +- ges/ges-xml-formatter.c | 150 +++++++++++++++++++++++++----------------------- 2 files changed, 81 insertions(+), 72 deletions(-) diff --git a/ges/ges-timeline.c b/ges/ges-timeline.c index ca8f551..3394e41 100644 --- a/ges/ges-timeline.c +++ b/ges/ges-timeline.c @@ -2247,9 +2247,10 @@ gboolean ges_timeline_save_to_uri (GESTimeline * timeline, const gchar * uri, GESAsset * formatter_asset, gboolean overwrite, GError ** error) { - gboolean ret, created_proj; GESProject *project; + gboolean ret, created_proj = FALSE; + g_return_val_if_fail (GES_IS_TIMELINE (timeline), FALSE); project = GES_PROJECT (ges_extractable_get_asset (GES_EXTRACTABLE (timeline))); diff --git a/ges/ges-xml-formatter.c b/ges/ges-xml-formatter.c index 145a40c..b539eea 100644 --- a/ges/ges-xml-formatter.c +++ b/ges/ges-xml-formatter.c @@ -701,17 +701,10 @@ _error_parsing (GMarkupParseContext * context, GError * error, /* XML writting utils */ static inline void -append_printf_escaped (GString * str, const gchar * format, ...) +append_escaped (GString * str, gchar * tmpstr) { - gchar *tmp; - va_list args; - - va_start (args, format); - tmp = g_markup_vprintf_escaped (format, args); - va_end (args); - - g_string_append (str, tmp); - g_free (tmp); + g_string_append (str, tmpstr); + g_free (tmpstr); } static inline gboolean @@ -785,11 +778,12 @@ _save_assets (GString * str, GESProject * project) asset = GES_ASSET (tmp->data); properties = _serialize_properties (G_OBJECT (asset), NULL); metas = ges_meta_container_metas_to_string (GES_META_CONTAINER (asset)); - append_printf_escaped (str, - "\n", - ges_asset_get_id (asset), - g_type_name (ges_asset_get_extractable_type (asset)), properties, - metas); + append_escaped (str, + g_markup_printf_escaped + ("\n", + ges_asset_get_id (asset), + g_type_name (ges_asset_get_extractable_type (asset)), properties, + metas)); g_free (properties); g_free (metas); } @@ -810,9 +804,10 @@ _save_tracks (GString * str, GESTimeline * timeline) track = GES_TRACK (tmp->data); strtmp = gst_caps_to_string (ges_track_get_caps (track)); metas = ges_meta_container_metas_to_string (GES_META_CONTAINER (track)); - append_printf_escaped (str, - "\n", - strtmp, track->type, nb_tracks++, metas); + append_escaped (str, + g_markup_printf_escaped + ("\n", + strtmp, track->type, nb_tracks++, metas)); g_free (strtmp); g_free (metas); } @@ -845,12 +840,13 @@ _save_keyframes (GString * str, GESTrackElement * trackelement) GList *timed_values, *tmp; GstInterpolationMode mode; - append_printf_escaped (str, - "\n"); + append_escaped (str, g_markup_printf_escaped ("'/>\n")); } else GST_DEBUG ("control source not in [interpolation]"); } else @@ -899,12 +895,12 @@ _save_effect (GString * str, guint clip_id, GESTrackElement * trackelement, "in-point", "duration", "locked", "max-duration", "name", NULL); metas = ges_meta_container_metas_to_string (GES_META_CONTAINER (trackelement)); - append_printf_escaped (str, - "type, track_id, - properties, metas); + append_escaped (str, + g_markup_printf_escaped ("type, track_id, + properties, metas)); g_free (properties); g_free (metas); @@ -924,12 +920,13 @@ _save_effect (GString * str, guint clip_id, GESTrackElement * trackelement, } g_free (pspecs); - append_printf_escaped (str, " children-properties='%s'>\n", - gst_structure_to_string (structure)); + append_escaped (str, + g_markup_printf_escaped (" children-properties='%s'>\n", + gst_structure_to_string (structure))); _save_keyframes (str, trackelement); - append_printf_escaped (str, "\n"); + append_escaped (str, g_markup_printf_escaped ("\n")); gst_structure_free (structure); } @@ -950,9 +947,10 @@ _save_layers (GString * str, GESTimeline * timeline) priority = ges_timeline_layer_get_priority (layer); properties = _serialize_properties (G_OBJECT (layer), "priority", NULL); metas = ges_meta_container_metas_to_string (GES_META_CONTAINER (layer)); - append_printf_escaped (str, - "\n", priority, - properties, metas); + append_escaped (str, + g_markup_printf_escaped + ("\n", priority, + properties, metas)); g_free (properties); g_free (metas); @@ -968,15 +966,15 @@ _save_layers (GString * str, GESTimeline * timeline) properties = _serialize_properties (G_OBJECT (clip), "supported-formats", "rate", "in-point", "start", "duration", "max-duration", "priority", "vtype", "uri", NULL); - append_printf_escaped (str, - "\n", nbclips, - ges_extractable_get_id (GES_EXTRACTABLE (clip)), - g_type_name (G_OBJECT_TYPE (clip)), priority, - ges_clip_get_supported_formats (clip), _START (clip), - _DURATION (clip), _INPOINT (clip), 0, properties); + append_escaped (str, + g_markup_printf_escaped ("\n", nbclips, + ges_extractable_get_id (GES_EXTRACTABLE (clip)), + g_type_name (G_OBJECT_TYPE (clip)), priority, + ges_clip_get_supported_formats (clip), _START (clip), + _DURATION (clip), _INPOINT (clip), 0, properties)); g_free (properties); for (tmpeffect = effects; tmpeffect; tmpeffect = tmpeffect->next) @@ -999,8 +997,9 @@ _save_timeline (GString * str, GESTimeline * timeline) "async-handling", "message-forward", NULL); metas = ges_meta_container_metas_to_string (GES_META_CONTAINER (timeline)); - append_printf_escaped (str, "\n", - properties, metas); + append_escaped (str, + g_markup_printf_escaped ("\n", + properties, metas)); _save_tracks (str, timeline); _save_layers (str, timeline); @@ -1019,39 +1018,42 @@ _save_stream_profiles (GString * str, GstEncodingProfile * sprof, GstCaps *tmpcaps; const gchar *preset, *preset_name, *name, *description; - append_printf_escaped (str, "\n"); @@ -1084,20 +1087,23 @@ _save_encoding_profiles (GString * str, GESProject * project) profpresetname = gst_encoding_profile_get_preset_name (prof); proftype = gst_encoding_profile_get_type_nick (prof); - append_printf_escaped (str, - "\n", NULL); + append_escaped (str, + g_markup_printf_escaped ("\n", NULL)); } } @@ -1138,8 +1145,9 @@ _save (GESFormatter * formatter, GESTimeline * timeline, GError ** error) MINOR_VERSION); properties = _serialize_properties (G_OBJECT (project), NULL); metas = ges_meta_container_metas_to_string (GES_META_CONTAINER (project)); - append_printf_escaped (str, "\n", - properties, metas); + append_escaped (str, + g_markup_printf_escaped ("\n", + properties, metas)); g_free (properties); g_free (metas); -- 2.7.4