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.
pull/59/head
Luca Barbato 13 years ago
parent b0970a69d1
commit c6eeb9b7b6
  1. 2
      doc/protocols.texi
  2. 3
      libavformat/rtmpproto.c

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

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

Loading…
Cancel
Save