Commit 702d9a23 authored by Stefano Sabatini's avatar Stefano Sabatini

lavf/tcp: honor listen option value in a tag

Consistent with what is done in udp.c, allow to explicitly disable listen
with listen=0.
parent b80cf460
...@@ -79,8 +79,13 @@ static int tcp_open(URLContext *h, const char *uri, int flags) ...@@ -79,8 +79,13 @@ static int tcp_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)) if (av_find_info_tag(buf, sizeof(buf), "listen", p)) {
char *endptr = NULL;
s->listen = strtol(buf, &endptr, 10);
/* assume if no digits were found it is a request to enable it */
if (buf == endptr)
s->listen = 1; s->listen = 1;
}
if (av_find_info_tag(buf, sizeof(buf), "timeout", p)) { if (av_find_info_tag(buf, sizeof(buf), "timeout", p)) {
s->rw_timeout = strtol(buf, NULL, 10); s->rw_timeout = strtol(buf, NULL, 10);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment