mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-26 17:18:15 +00:00
rtpsrc: Fix wrong/NULL URI handling
We can reset the URI to NULL and this fix a deadlock in that case or when the URI was invalid. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2132>
This commit is contained in:
parent
fe190fb5eb
commit
788dfdbfa6
1 changed files with 16 additions and 3 deletions
|
@ -177,16 +177,29 @@ gst_rtp_src_set_property (GObject * object, guint prop_id,
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_URI:{
|
case PROP_URI:{
|
||||||
GstUri *uri = NULL;
|
GstUri *uri = NULL;
|
||||||
|
const gchar *str_uri = g_value_get_string (value);
|
||||||
|
|
||||||
GST_RTP_SRC_LOCK (object);
|
GST_RTP_SRC_LOCK (object);
|
||||||
uri = gst_uri_from_string (g_value_get_string (value));
|
uri = gst_uri_from_string (str_uri);
|
||||||
if (uri == NULL)
|
if (uri == NULL) {
|
||||||
|
if (str_uri) {
|
||||||
|
GST_RTP_SRC_UNLOCK (object);
|
||||||
|
GST_ERROR_OBJECT (object, "Invalid uri: %s", str_uri);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (self->uri)
|
if (self->uri)
|
||||||
gst_uri_unref (self->uri);
|
gst_uri_unref (self->uri);
|
||||||
self->uri = uri;
|
self->uri = uri;
|
||||||
|
|
||||||
|
if (!uri) {
|
||||||
|
GST_RTP_SRC_UNLOCK (object);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* Recursive set to self, do not use the same lock in all property
|
/* Recursive set to self, do not use the same lock in all property
|
||||||
* setters. */
|
* setters. */
|
||||||
g_object_set (self, "address", gst_uri_get_host (self->uri), NULL);
|
g_object_set (self, "address", gst_uri_get_host (self->uri), NULL);
|
||||||
|
|
Loading…
Reference in a new issue