mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-14 11:00:08 +01:00
avformat/sctp: use ff_parse_opts_from_query_string() to set URL parameters
Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
@@ -1535,7 +1535,15 @@ The accepted URL syntax is:
|
|||||||
sctp://@var{host}:@var{port}[?@var{options}]
|
sctp://@var{host}:@var{port}[?@var{options}]
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
The protocol accepts the following options:
|
@var{options} contains a list of &-separated options of the form
|
||||||
|
@var{key}=@var{val}. Standard percent-encoding (and using the plus sign for
|
||||||
|
space) can be used to escape keys and values.
|
||||||
|
|
||||||
|
Options can also can be specified via command line options (or in code via
|
||||||
|
@code{AVOption}s).
|
||||||
|
|
||||||
|
The list of supported options follows.
|
||||||
|
|
||||||
@table @option
|
@table @option
|
||||||
@item listen
|
@item listen
|
||||||
If set to any value, listen for an incoming connection. Outgoing connection is done by default.
|
If set to any value, listen for an incoming connection. Outgoing connection is done by default.
|
||||||
|
|||||||
@@ -185,7 +185,6 @@ static int sctp_open(URLContext *h, const char *uri, int flags)
|
|||||||
int fd = -1;
|
int fd = -1;
|
||||||
SCTPContext *s = h->priv_data;
|
SCTPContext *s = h->priv_data;
|
||||||
const char *p;
|
const char *p;
|
||||||
char buf[256];
|
|
||||||
int ret;
|
int ret;
|
||||||
char hostname[1024], proto[1024], path[1024];
|
char hostname[1024], proto[1024], path[1024];
|
||||||
char portstr[10];
|
char portstr[10];
|
||||||
@@ -201,10 +200,9 @@ static int sctp_open(URLContext *h, const char *uri, int flags)
|
|||||||
|
|
||||||
p = strchr(uri, '?');
|
p = strchr(uri, '?');
|
||||||
if (p) {
|
if (p) {
|
||||||
if (av_find_info_tag(buf, sizeof(buf), "listen", p))
|
ret = ff_parse_opts_from_query_string(s, p, 0);
|
||||||
s->listen = 1;
|
if (ret < 0)
|
||||||
if (av_find_info_tag(buf, sizeof(buf), "max_streams", p))
|
return ret;
|
||||||
s->max_streams = strtol(buf, NULL, 10);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
hints.ai_family = AF_UNSPEC;
|
hints.ai_family = AF_UNSPEC;
|
||||||
|
|||||||
Reference in New Issue
Block a user