From 30b2abaddd84a7f8bc61c8ebdc58b934c94712b4 Mon Sep 17 00:00:00 2001 From: Miguel Angel Cabrera Moya Date: Mon, 16 May 2011 15:35:50 +0200 Subject: [PATCH] rtspconnection: not enter in not controllable state unless it is necessary 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/rtsp/gstrtspconnection.c b/gst-libs/gst/rtsp/gstrtspconnection.c index 0c1f22b990..c26c960a26 100644 --- a/gst-libs/gst/rtsp/gstrtspconnection.c +++ b/gst-libs/gst/rtsp/gstrtspconnection.c @@ -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 */