From ba6dbaecfc4beb7d9749cb613defcf6c4c05e522 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 15 Mar 2010 11:38:23 +0100 Subject: [PATCH] rtspsrc: don't forget to send keepalive messages When we operate in TCP mode, still send keepalive messages when we need to. Fixes #612696 --- gst/rtsp/gstrtspsrc.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c index 59302b1..2c68756 100644 --- a/gst/rtsp/gstrtspsrc.c +++ b/gst/rtsp/gstrtspsrc.c @@ -3014,8 +3014,17 @@ gst_rtspsrc_loop_interleaved (GstRTSPSrc * src) /* get the next timeout interval */ gst_rtsp_connection_next_timeout (src->connection, &tv_timeout); - GST_DEBUG_OBJECT (src, "doing receive with timeout %d seconds", - (gint) tv_timeout.tv_sec); + /* see if the timeout period expired */ + if ((tv_timeout.tv_sec | tv_timeout.tv_usec) == 0) { + GST_DEBUG_OBJECT (src, "timout, sending keep-alive"); + /* send keep-alive, ignore the result, a warning will be posted. */ + gst_rtspsrc_send_keep_alive (src); + /* get new timeout */ + gst_rtsp_connection_next_timeout (src->connection, &tv_timeout); + } + + GST_DEBUG_OBJECT (src, "doing receive with timeout %ld seconds, %ld usec", + tv_timeout.tv_sec, tv_timeout.tv_usec); /* protect the connection with the connection lock so that we can see when * we are finished doing server communication */ -- 2.7.4