rtmp: fix url parsing

The application component can have a subcomponent to specify the
application instance even if it doesn't have a ":" in the playpath.
This commit is contained in:
Luca Barbato 2012-05-14 17:24:27 -07:00
parent b0970a69d1
commit c6eeb9b7b6
2 changed files with 3 additions and 2 deletions

View File

@ -164,7 +164,7 @@ content across a TCP/IP network.
The required syntax is:
@example
rtmp://@var{server}[:@var{port}][/@var{app}][/@var{playpath}]
rtmp://@var{server}[:@var{port}][/@var{app}][/@var{instance}][/@var{playpath}]
@end example
The accepted parameters are:

View File

@ -1037,9 +1037,10 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
fname = next;
rt->app[0] = '\0';
} else {
// make sure we do not mismatch a playpath for an application instance
char *c = strchr(p + 1, ':');
fname = strchr(p + 1, '/');
if (!fname || c < fname) {
if (!fname || (c && c < fname)) {
fname = p + 1;
av_strlcpy(rt->app, path + 1, p - path);
} else {