mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-23 04:24:35 +02:00
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.
This commit is contained in:
parent
b80cf46090
commit
702d9a23b3
@ -79,8 +79,13 @@ static int tcp_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), "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;
|
||||
}
|
||||
if (av_find_info_tag(buf, sizeof(buf), "timeout", p)) {
|
||||
s->rw_timeout = strtol(buf, NULL, 10);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user