diff --git a/doc/protocols.texi b/doc/protocols.texi index a329f59fe3..563aee6cc7 100644 --- a/doc/protocols.texi +++ b/doc/protocols.texi @@ -1535,7 +1535,15 @@ The accepted URL syntax is: sctp://@var{host}:@var{port}[?@var{options}] @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 @item listen If set to any value, listen for an incoming connection. Outgoing connection is done by default. diff --git a/libavformat/sctp.c b/libavformat/sctp.c index 9d9e90097e..4122fbe312 100644 --- a/libavformat/sctp.c +++ b/libavformat/sctp.c @@ -185,7 +185,6 @@ static int sctp_open(URLContext *h, const char *uri, int flags) int fd = -1; SCTPContext *s = h->priv_data; const char *p; - char buf[256]; int ret; char hostname[1024], proto[1024], path[1024]; char portstr[10]; @@ -201,10 +200,9 @@ static int sctp_open(URLContext *h, const char *uri, int flags) p = strchr(uri, '?'); if (p) { - if (av_find_info_tag(buf, sizeof(buf), "listen", p)) - s->listen = 1; - if (av_find_info_tag(buf, sizeof(buf), "max_streams", p)) - s->max_streams = strtol(buf, NULL, 10); + ret = ff_parse_opts_from_query_string(s, p, 0); + if (ret < 0) + return ret; } hints.ai_family = AF_UNSPEC;