OSDN Git Service
(root)
/
android-x86
/
external-ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b80cf46
)
lavf/tcp: honor listen option value in a tag
author
Stefano Sabatini
<stefasab@gmail.com>
Tue, 24 Dec 2013 15:48:45 +0000
(16:48 +0100)
committer
Stefano Sabatini
<stefasab@gmail.com>
Wed, 25 Dec 2013 17:42:20 +0000
(18:42 +0100)
Consistent with what is done in udp.c, allow to explicitly disable listen
with listen=0.
libavformat/tcp.c
patch
|
blob
|
history
diff --git
a/libavformat/tcp.c
b/libavformat/tcp.c
index
634d99d
..
07026e3
100644
(file)
--- a/
libavformat/tcp.c
+++ b/
libavformat/tcp.c
@@
-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);
}