92c40ef882 added a listen_timeout option
for sdp. This allowed a user to set variable timeout which was
originally hard coded to 10 seconds.
The commit used the initial_timeout variable to store the value. But
this variable is shared with rtsp where it's used to infer a "listen"
mode. Thus, the timeout value could not be set in rtsp, and the default
value (initial_timeout = -1) would give 100ms timeout.
This was attempted to be fixed in c8101aabee,
which changed the meaning of initial_timeout = -1 to be an infinite
timeout. However, it did not address the issue that the timeout could
still not be set. Being able to set the timeout is useful because it
allows to automatically reconfigure from a udp to tcp connection in the
lower transport.
In this commit this is fixed by using the stimeout variable to
store the timeout value.
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
{"min_port","set minimum local UDP port",OFFSET(rtp_port_min),AV_OPT_TYPE_INT,{.i64=RTSP_RTP_PORT_MIN},0,65535,DEC|ENC},
{"min_port","set minimum local UDP port",OFFSET(rtp_port_min),AV_OPT_TYPE_INT,{.i64=RTSP_RTP_PORT_MIN},0,65535,DEC|ENC},
{"max_port","set maximum local UDP port",OFFSET(rtp_port_max),AV_OPT_TYPE_INT,{.i64=RTSP_RTP_PORT_MAX},0,65535,DEC|ENC},
{"max_port","set maximum local UDP port",OFFSET(rtp_port_max),AV_OPT_TYPE_INT,{.i64=RTSP_RTP_PORT_MAX},0,65535,DEC|ENC},
{"listen_timeout","set maximum timeout (in seconds) to wait for incoming connections (-1 is infinite, imply flag listen)",OFFSET(initial_timeout),AV_OPT_TYPE_INT,{.i64=-1},INT_MIN,INT_MAX,DEC},
{"listen_timeout","set maximum timeout (in seconds) to wait for incoming connections (-1 is infinite, imply flag listen)",OFFSET(initial_timeout),AV_OPT_TYPE_INT,{.i64=-1},INT_MIN,INT_MAX,DEC},
{"timeout","set timeout (in microseconds) of socket TCP I/O operations",OFFSET(stimeout),AV_OPT_TYPE_INT,{.i64=0},INT_MIN,INT_MAX,DEC},
{"timeout","set timeout (in microseconds) of socket I/O operations",OFFSET(stimeout),AV_OPT_TYPE_INT64,{.i64=0},INT_MIN,INT64_MAX,DEC},
{"rtcp_to_source","send RTCP packets to the source address of received packets",0,AV_OPT_TYPE_CONST,{.i64=RTSP_FLAG_RTCP_TO_SOURCE},0,0,DEC,"rtsp_flags"},
{"rtcp_to_source","send RTCP packets to the source address of received packets",0,AV_OPT_TYPE_CONST,{.i64=RTSP_FLAG_RTCP_TO_SOURCE},0,0,DEC,"rtsp_flags"},
{"listen_timeout","set maximum timeout (in seconds) to wait for incoming connections",OFFSET(initial_timeout),AV_OPT_TYPE_INT,{.i64=READ_PACKET_TIMEOUT_S},INT_MIN,INT_MAX,DEC},
{"listen_timeout","set maximum timeout (in seconds) to wait for incoming connections",OFFSET(stimeout),AV_OPT_TYPE_DURATION,{.i64=READ_PACKET_TIMEOUT_S*1000000},INT_MIN,INT64_MAX,DEC},
RTSP_MEDIATYPE_OPTS("allowed_media_types","set media types to accept from the server"),
RTSP_MEDIATYPE_OPTS("allowed_media_types","set media types to accept from the server"),
{"listen_timeout","set maximum timeout (in seconds) to wait for incoming connections",OFFSET(initial_timeout),AV_OPT_TYPE_INT,{.i64=READ_PACKET_TIMEOUT_S},INT_MIN,INT_MAX,DEC},
{"listen_timeout","set maximum timeout (in seconds) to wait for incoming connections",OFFSET(stimeout),AV_OPT_TYPE_DURATION,{.i64=READ_PACKET_TIMEOUT_S*1000000},INT_MIN,INT64_MAX,DEC},
RTSP_MEDIATYPE_OPTS("allowed_media_types","set media types to accept from the server"),
RTSP_MEDIATYPE_OPTS("allowed_media_types","set media types to accept from the server"),