1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-10 06:10:52 +02:00

Send OPTIONS request at a regular basis to standard RTSP servers as well,

this prevents a time-out which closes the TCP connection and kills our
session.

see "Re: [FFmpeg-devel] [PATCH] rtsp.c: keep-alive" thread on mailinglist.

Originally committed as revision 24785 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Ronald S. Bultje
2010-08-12 13:39:38 +00:00
parent d68776d54f
commit 27014bf5a3

View File

@@ -1902,9 +1902,7 @@ static int rtsp_read_packet(AVFormatContext *s, AVPacket *pkt)
return ret; return ret;
/* send dummy request to keep TCP connection alive */ /* send dummy request to keep TCP connection alive */
if ((rt->server_type == RTSP_SERVER_WMS || if ((av_gettime() - rt->last_cmd_time) / 1000000 >= rt->timeout / 2) {
rt->server_type == RTSP_SERVER_REAL) &&
(av_gettime() - rt->last_cmd_time) / 1000000 >= rt->timeout / 2) {
if (rt->server_type == RTSP_SERVER_WMS) { if (rt->server_type == RTSP_SERVER_WMS) {
ff_rtsp_send_cmd_async(s, "GET_PARAMETER", rt->control_uri, NULL); ff_rtsp_send_cmd_async(s, "GET_PARAMETER", rt->control_uri, NULL);
} else { } else {