[FFmpeg-cvslog] rtmp: fix url parsing

Luca Barbato git at videolan.org
Sat May 26 22:41:51 CEST 2012


ffmpeg | branch: master | Luca Barbato <lu_zero at gentoo.org> | Mon May 14 17:24:27 2012 -0700| [c6eeb9b7b6bbf5d0f507cad522ed5a4f929de14f] | committer: Luca Barbato

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.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c6eeb9b7b6bbf5d0f507cad522ed5a4f929de14f
---

 doc/protocols.texi      |    2 +-
 libavformat/rtmpproto.c |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/doc/protocols.texi b/doc/protocols.texi
index d6e12f7..172184e 100644
--- a/doc/protocols.texi
+++ b/doc/protocols.texi
@@ -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:
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index 9af4584..807e899 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -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 {



More information about the ffmpeg-cvslog mailing list