aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-07-25 22:00:06 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-07-25 22:00:06 +0200
commitf7d4e26c6a0a11c255e22994fabd97a4e62e3d01 (patch)
tree65c18e3f9064ed481b0001beac05e194232260eb /libavformat
parent9746f87f154029ed5866cbc02ba0d57f5b5c283f (diff)
parent758377a2b79a35386978b0af1196d36cbcfb8f64 (diff)
downloadffmpeg-f7d4e26c6a0a11c255e22994fabd97a4e62e3d01.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: rtmp: Add a new option 'rtmp_pageurl' doc: Update the description of the rtmp_tcurl option rtmp: Make the description of the rtmp_tcurl option more generic libfdk-aacenc: add LATM/LOAS encapsulation support sctp: add port missing error message tcp: add port missing error message avfilter: Fix printf format string conversion specifier Conflicts: libavcodec/version.h libavfilter/avfilter.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/rtmpproto.c9
-rw-r--r--libavformat/sctp.c6
-rw-r--r--libavformat/tcp.c7
3 files changed, 18 insertions, 4 deletions
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index 4ffd48eeec..2ebb998187 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -90,6 +90,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* pageurl; ///< url of the web page
int server_bw; ///< server bandwidth
int client_buffer_time; ///< client buffer time in ms
int flush_interval; ///< number of packets flushed in the same request (RTMPT only)
@@ -232,6 +233,11 @@ static int gen_connect(URLContext *s, RTMPContext *rt)
ff_amf_write_number(&p, 252.0);
ff_amf_write_field_name(&p, "videoFunction");
ff_amf_write_number(&p, 1.0);
+
+ if (rt->pageurl) {
+ ff_amf_write_field_name(&p, "pageUrl");
+ ff_amf_write_string(&p, rt->pageurl);
+ }
}
ff_amf_write_object_end(&p);
@@ -1498,9 +1504,10 @@ static const AVOption rtmp_options[] = {
{"any", "both", 0, AV_OPT_TYPE_CONST, {-2}, 0, 0, DEC, "rtmp_live"},
{"live", "live stream", 0, AV_OPT_TYPE_CONST, {-1}, 0, 0, DEC, "rtmp_live"},
{"recorded", "recorded stream", 0, AV_OPT_TYPE_CONST, {0}, 0, 0, DEC, "rtmp_live"},
+ {"rtmp_pageurl", "URL of the web page in which the media was embedded. By default no value will be sent.", OFFSET(pageurl), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC},
{"rtmp_playpath", "Stream identifier to play or to publish", OFFSET(playpath), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC},
{"rtmp_swfurl", "URL of the SWF player. By default no value will be sent", OFFSET(swfurl), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC},
- {"rtmp_tcurl", "URL of the target stream. Defaults to rtmp://host[:port]/app.", OFFSET(tcurl), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC},
+ {"rtmp_tcurl", "URL of the target stream. Defaults to proto://host[:port]/app.", OFFSET(tcurl), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC|ENC},
{ NULL },
};
diff --git a/libavformat/sctp.c b/libavformat/sctp.c
index 7bcb5ae0a9..b8ab63e7da 100644
--- a/libavformat/sctp.c
+++ b/libavformat/sctp.c
@@ -170,8 +170,12 @@ static int sctp_open(URLContext *h, const char *uri, int flags)
av_url_split(proto, sizeof(proto), NULL, 0, hostname, sizeof(hostname),
&port, path, sizeof(path), uri);
- if (strcmp(proto,"sctp") || port <= 0 || port >= 65536)
+ if (strcmp(proto, "sctp"))
return AVERROR(EINVAL);
+ if (port <= 0 || port >= 65536) {
+ av_log(s, AV_LOG_ERROR, "Port missing in uri\n");
+ return AVERROR(EINVAL);
+ }
s->max_streams = 0;
p = strchr(uri, '?');
diff --git a/libavformat/tcp.c b/libavformat/tcp.c
index 70a50159eb..8cd217b697 100644
--- a/libavformat/tcp.c
+++ b/libavformat/tcp.c
@@ -49,9 +49,12 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
av_url_split(proto, sizeof(proto), NULL, 0, hostname, sizeof(hostname),
&port, path, sizeof(path), uri);
- if (strcmp(proto,"tcp") || port <= 0 || port >= 65536)
+ if (strcmp(proto, "tcp"))
return AVERROR(EINVAL);
-
+ if (port <= 0 || port >= 65536) {
+ av_log(h, AV_LOG_ERROR, "Port missing in uri\n");
+ return AVERROR(EINVAL);
+ }
p = strchr(uri, '?');
if (p) {
if (av_find_info_tag(buf, sizeof(buf), "listen", p))