The hostname will be used for sending POST requests of RTMPT.
---
libavformat/rtmpproto.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index 427655c..683f490 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -87,6 +87,7 @@ typedef struct RTMPContext {
char* tcurl; ///< url of the target stream
char* flashver; ///< version of the flash plugin
char* swfurl; ///< url of the swf player
+ char host[256]; ///< hostname of the flash server
} RTMPContext;
#define PLAYER_KEY_OPEN_PART_LEN 30 ///< length of partial key used for
first client digest signing
@@ -853,7 +854,7 @@ static int rtmp_close(URLContext *h)
static int rtmp_open(URLContext *s, const char *uri, int flags)
{
RTMPContext *rt = s->priv_data;
- char proto[8], hostname[256], path[1024], *fname;
+ char proto[8], path[1024], *fname;
char *old_app;
uint8_t buf[2048];
int port;
@@ -861,12 +862,12 @@ static int rtmp_open(URLContext *s, const char *uri, int
flags)
rt->is_input = !(flags & AVIO_FLAG_WRITE);
- av_url_split(proto, sizeof(proto), NULL, 0, hostname, sizeof(hostname),
&port,
+ av_url_split(proto, sizeof(proto), NULL, 0, rt->host, sizeof(rt->host),
&port,
path, sizeof(path), s->filename);
if (port < 0)
port = RTMP_DEFAULT_PORT;
- ff_url_join(buf, sizeof(buf), "tcp", NULL, hostname, port, NULL);
+ ff_url_join(buf, sizeof(buf), "tcp", NULL, rt->host, port, NULL);
if (ffurl_open(&rt->stream, buf, AVIO_FLAG_READ_WRITE,
&s->interrupt_callback, NULL) < 0) {
@@ -937,7 +938,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, hostname,
+ ff_url_join(rt->tcurl, TCURL_MAX_LENGTH, proto, NULL, rt->host,
port, "/%s", rt->app);
}
--
1.7.10.1
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel