rtspconnection: not enter in not controllable state unless it is necessary
authorMiguel Angel Cabrera Moya <madmac2501@gmail.com>
Mon, 16 May 2011 13:35:50 +0000 (15:35 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Tue, 17 May 2011 07:27:25 +0000 (09:27 +0200)
When closing rtspsrc the state change blocks until the polling in the
connection timeouts. This is because the second time we loop to read a
full message controllable is set to FALSE in the poll group, even though no
message is half read.
This can be avoided by not setting controllable to FALSE the poll group
unless we had begin to read a message.

Fixes #610916

gst-libs/gst/rtsp/gstrtspconnection.c

index 0c1f22b..c26c960 100644 (file)
@@ -2269,7 +2269,9 @@ gst_rtsp_connection_receive (GstRTSPConnection * conn, GstRTSPMessage * message,
     if (gst_poll_fd_has_error (conn->fdset, conn->writefd))
       goto socket_error;
 
-    gst_poll_set_controllable (conn->fdset, FALSE);
+    /* once we start reading the wait cannot be controlled */
+    if (builder.state != STATE START)
+      gst_poll_set_controllable (conn->fdset, FALSE);
   }
 
   /* we have a message here */