rtmp2src: fix playback of URIs without a playpath
ffmpeg manages to play RTMP URLs in the form: ``` protocol://servername:port/appname ``` and does not require a second component to the path, adapt our code to allow using such URLs as `tcUrl`. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9360>
This commit is contained in:
parent
c43d3900bf
commit
668ef84171
@ -173,11 +173,6 @@ uri_handler_set_uri (GstURIHandler * handler, const gchar * string,
|
||||
}
|
||||
|
||||
stream_sep = strrchr (path_sep + 1, '/');
|
||||
if (!stream_sep) {
|
||||
g_set_error (error, GST_URI_ERROR, GST_URI_ERROR_BAD_REFERENCE,
|
||||
"URI lacks stream: %s", string);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
{
|
||||
gchar *string_without_path = g_strndup (string, path_sep - string);
|
||||
@ -213,8 +208,10 @@ uri_handler_set_uri (GstURIHandler * handler, const gchar * string,
|
||||
}
|
||||
|
||||
{
|
||||
const gchar *path = path_sep + 1, *stream = stream_sep + 1;
|
||||
gchar *application = g_strndup (path, stream_sep - path);
|
||||
const gchar *path = path_sep + 1;
|
||||
const gchar *stream = stream_sep ? stream_sep + 1 : "";
|
||||
gchar *application =
|
||||
stream_sep ? g_strndup (path, stream_sep - path) : g_strdup (path);
|
||||
|
||||
GST_DEBUG_OBJECT (self, "setting location to %s://%s:%u/%s stream %s",
|
||||
gst_rtmp_scheme_to_string (scheme), host, port, application, stream);
|
||||
|
Loading…
x
Reference in New Issue
Block a user