mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-11-08 06:17:41 +00:00
avformat/rtmpproto: fix listen_timeout conversion for special negative values
rtmpproto converts listen_timeout to milliseconds by multiplying it by 1000 before passing it to TCP. However, negative values are special sentinels (e.g., -1 for infinite wait) and should not be multiplied. This worked prior to commit49c6e6cc44because there was no range validation. Since that commit, ff_parse_opts_from_query_string validates option values against their declared ranges, causing these multiplied negative values to fail. Fixes ticket #22469. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com> (cherry picked from commitf189657ec6) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
1 parent
d93705927b
commit
259ed8bc22
1 file changed
+2
-1
@@ -2674,7 +2674,8 @@ static int rtmp_open(URLContext *s, const char *uri, int flags, AVDictionary **o
|
||||
if (rt->listen)
|
||||
ff_url_join(buf, sizeof(buf), "tcp", NULL, hostname, port,
|
||||
"?listen&listen_timeout=%d&tcp_nodelay=%d",
|
||||
rt->listen_timeout * 1000, rt->tcp_nodelay);
|
||||
rt->listen_timeout < 0 ? -1 : rt->listen_timeout * 1000,
|
||||
rt->tcp_nodelay);
|
||||
else
|
||||
ff_url_join(buf, sizeof(buf), "tcp", NULL, hostname, port, "?tcp_nodelay=%d", rt->tcp_nodelay);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user