srt: Use default host and port if uri doesn't provide

This commit is contained in:
Justin Kim 2019-01-22 13:02:30 +09:00
parent 2bb907eb9c
commit dc28105220

View file

@ -494,15 +494,18 @@ gst_srt_object_validate_parameters (GstStructure * s, GstUri * uri)
guint local_port; guint local_port;
const gchar *local_address = gst_structure_get_string (s, "localaddress"); const gchar *local_address = gst_structure_get_string (s, "localaddress");
if (local_address == NULL) { if (local_address == NULL) {
gst_srt_object_set_string_value (s, "localaddress", local_address =
GST_SRT_DEFAULT_LOCALADDRESS); gst_uri_get_host (uri) ==
NULL ? GST_SRT_DEFAULT_LOCALADDRESS : gst_uri_get_host (uri);
gst_srt_object_set_string_value (s, "localaddress", local_address);
} }
if (!gst_structure_get_uint (s, "localport", &local_port)) { if (!gst_structure_get_uint (s, "localport", &local_port)) {
gst_srt_object_set_uint_value (s, "localport", local_port =
G_STRINGIFY (GST_SRT_DEFAULT_PORT)); gst_uri_get_port (uri) ==
GST_URI_NO_PORT ? GST_SRT_DEFAULT_PORT : gst_uri_get_port (uri);
gst_structure_set (s, "localport", G_TYPE_UINT, local_port, NULL);
} }
} }
} }