rtsp: don't let the rtsp connection timeout
authorThijs Vermeir <thijsvermeir@gmail.com>
Fri, 29 Oct 2010 12:24:54 +0000 (14:24 +0200)
committerWim Taymans <wim.taymans@gmail.com>
Fri, 29 Oct 2010 13:22:39 +0000 (14:22 +0100)
Because we should act before the rtsp server does a timeout, we
reduce the timeout-time with 5 seconds, this should be safe to always
keep te rtsp connection alive.

https://bugzilla.gnome.org/show_bug.cgi?id=633455

gst-libs/gst/rtsp/gstrtspconnection.c

index 39bf608..0738522 100644 (file)
@@ -2486,7 +2486,9 @@ gst_rtsp_connection_next_timeout (GstRTSPConnection * conn, GTimeVal * timeout)
   g_return_val_if_fail (conn != NULL, GST_RTSP_EINVAL);
   g_return_val_if_fail (timeout != NULL, GST_RTSP_EINVAL);
 
-  elapsed = g_timer_elapsed (conn->timer, &usec);
+  /* Because we should act before the timeout we timeout 5
+   * seconds in advance. */
+  elapsed = g_timer_elapsed (conn->timer, &usec) + 5;
   if (elapsed >= conn->timeout) {
     sec = 0;
     usec = 0;