Commit aff2de6d authored by Justin Kim's avatar Justin Kim Committed by Thibault Saunier
Browse files

uri-asset: don't leak uri string

https://bugzilla.gnome.org/show_bug.cgi?id=755505
parent 28b74c14
...@@ -577,6 +577,7 @@ G_DEFINE_TYPE (GESUriSourceAsset, ges_uri_source_asset, ...@@ -577,6 +577,7 @@ G_DEFINE_TYPE (GESUriSourceAsset, ges_uri_source_asset,
static GESExtractable * static GESExtractable *
_extract (GESAsset * asset, GError ** error) _extract (GESAsset * asset, GError ** error)
{ {
gchar *uri = NULL;
GESTrackElement *trackelement; GESTrackElement *trackelement;
GESUriSourceAssetPrivate *priv = GES_URI_SOURCE_ASSET (asset)->priv; GESUriSourceAssetPrivate *priv = GES_URI_SOURCE_ASSET (asset)->priv;
...@@ -592,24 +593,24 @@ _extract (GESAsset * asset, GError ** error) ...@@ -592,24 +593,24 @@ _extract (GESAsset * asset, GError ** error)
return NULL; return NULL;
} }
uri = g_strdup (priv->uri);
if (g_str_has_prefix (priv->uri, GES_MULTI_FILE_URI_PREFIX)) { if (g_str_has_prefix (priv->uri, GES_MULTI_FILE_URI_PREFIX)) {
trackelement = trackelement = GES_TRACK_ELEMENT (ges_multi_file_source_new (uri));
GES_TRACK_ELEMENT (ges_multi_file_source_new (g_strdup (priv->uri)));
} else if (GST_IS_DISCOVERER_VIDEO_INFO (priv->sinfo) } else if (GST_IS_DISCOVERER_VIDEO_INFO (priv->sinfo)
&& gst_discoverer_video_info_is_image ((GstDiscovererVideoInfo *) && gst_discoverer_video_info_is_image ((GstDiscovererVideoInfo *)
priv->sinfo)) priv->sinfo))
trackelement = trackelement = GES_TRACK_ELEMENT (ges_image_source_new (uri));
GES_TRACK_ELEMENT (ges_image_source_new (g_strdup (priv->uri)));
else if (GST_IS_DISCOVERER_VIDEO_INFO (priv->sinfo)) else if (GST_IS_DISCOVERER_VIDEO_INFO (priv->sinfo))
trackelement = trackelement = GES_TRACK_ELEMENT (ges_video_uri_source_new (uri));
GES_TRACK_ELEMENT (ges_video_uri_source_new (g_strdup (priv->uri)));
else else
trackelement = trackelement = GES_TRACK_ELEMENT (ges_audio_uri_source_new (uri));
GES_TRACK_ELEMENT (ges_audio_uri_source_new (g_strdup (priv->uri)));
ges_track_element_set_track_type (trackelement, ges_track_element_set_track_type (trackelement,
ges_track_element_asset_get_track_type (GES_TRACK_ELEMENT_ASSET (asset))); ges_track_element_asset_get_track_type (GES_TRACK_ELEMENT_ASSET (asset)));
g_free (uri);
return GES_EXTRACTABLE (trackelement); return GES_EXTRACTABLE (trackelement);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment