urihandler: make _get_uri() return a copy

For thread-safety.
This commit is contained in:
Tim-Philipp Müller 2011-11-13 15:51:44 +00:00
parent 34e3e26467
commit 35df64357f
2 changed files with 4 additions and 4 deletions

View file

@ -669,11 +669,11 @@ gst_uri_handler_get_protocols (GstURIHandler * handler)
* Returns NULL if there are no URI currently handled. The * Returns NULL if there are no URI currently handled. The
* returned string must not be modified or freed. * returned string must not be modified or freed.
*/ */
const gchar * gchar *
gst_uri_handler_get_uri (GstURIHandler * handler) gst_uri_handler_get_uri (GstURIHandler * handler)
{ {
GstURIHandlerInterface *iface; GstURIHandlerInterface *iface;
const gchar *ret; gchar *ret;
g_return_val_if_fail (GST_IS_URI_HANDLER (handler), NULL); g_return_val_if_fail (GST_IS_URI_HANDLER (handler), NULL);

View file

@ -87,7 +87,7 @@ struct _GstURIHandlerInterface {
gchar ** (* get_protocols) (GType type); gchar ** (* get_protocols) (GType type);
/* using the interface */ /* using the interface */
const gchar * (* get_uri) (GstURIHandler * handler); gchar * (* get_uri) (GstURIHandler * handler);
gboolean (* set_uri) (GstURIHandler * handler, gboolean (* set_uri) (GstURIHandler * handler,
const gchar * uri); const gchar * uri);
}; };
@ -117,7 +117,7 @@ GType gst_uri_handler_get_type (void);
guint gst_uri_handler_get_uri_type (GstURIHandler * handler); guint gst_uri_handler_get_uri_type (GstURIHandler * handler);
gchar ** gst_uri_handler_get_protocols (GstURIHandler * handler); gchar ** gst_uri_handler_get_protocols (GstURIHandler * handler);
const gchar * gst_uri_handler_get_uri (GstURIHandler * handler); gchar * gst_uri_handler_get_uri (GstURIHandler * handler);
gboolean gst_uri_handler_set_uri (GstURIHandler * handler, gboolean gst_uri_handler_set_uri (GstURIHandler * handler,
const gchar * uri); const gchar * uri);