The port will be used for sending POST requests of RTMPT.
---
 libavformat/rtmpproto.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index 683f490..e049c8a 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -88,6 +88,7 @@ typedef struct RTMPContext {
     char*         flashver;                   ///< version of the flash plugin
     char*         swfurl;                     ///< url of the swf player
     char          host[256];                  ///< hostname of the flash server
+    int           port;                       ///< port of the flash server
 } RTMPContext;
 
 #define PLAYER_KEY_OPEN_PART_LEN 30   ///< length of partial key used for 
first client digest signing
@@ -857,17 +858,16 @@ static int rtmp_open(URLContext *s, const char *uri, int 
flags)
     char proto[8], path[1024], *fname;
     char *old_app;
     uint8_t buf[2048];
-    int port;
     int ret;
 
     rt->is_input = !(flags & AVIO_FLAG_WRITE);
 
-    av_url_split(proto, sizeof(proto), NULL, 0, rt->host, sizeof(rt->host), 
&port,
+    av_url_split(proto, sizeof(proto), NULL, 0, rt->host, sizeof(rt->host), 
&rt->port,
                  path, sizeof(path), s->filename);
 
-    if (port < 0)
-        port = RTMP_DEFAULT_PORT;
-    ff_url_join(buf, sizeof(buf), "tcp", NULL, rt->host, port, NULL);
+    if (rt->port < 0)
+        rt->port = RTMP_DEFAULT_PORT;
+    ff_url_join(buf, sizeof(buf), "tcp", NULL, rt->host, rt->port, NULL);
 
     if (ffurl_open(&rt->stream, buf, AVIO_FLAG_READ_WRITE,
                    &s->interrupt_callback, NULL) < 0) {
@@ -939,7 +939,7 @@ static int rtmp_open(URLContext *s, const char *uri, int 
flags)
     if (!rt->tcurl) {
         rt->tcurl = av_malloc(TCURL_MAX_LENGTH);
         ff_url_join(rt->tcurl, TCURL_MAX_LENGTH, proto, NULL, rt->host,
-                    port, "/%s", rt->app);
+                    rt->port, "/%s", rt->app);
     }
 
     if (!rt->flashver) {
-- 
1.7.10.1

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to