summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2010-06-18 20:02:49 +0200
committerWim Taymans <wim.taymans@collabora.co.uk>2010-06-18 20:04:08 +0200
commit5534c7d91d6faed2c5c69bf3c1040b38e2086780 (patch)
treeed7a3fffe04e0814f8061be40dc7acc4ead1bc7b
parent0b379913444e611939c94959598cbd3f70f151a5 (diff)
rtspsrc: fix locking after moving things around
-rw-r--r--gst/rtsp/gstrtspsrc.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c
index db5429c64..4dae55237 100644
--- a/gst/rtsp/gstrtspsrc.c
+++ b/gst/rtsp/gstrtspsrc.c
@@ -5137,8 +5137,6 @@ gst_rtspsrc_retrieve_sdp (GstRTSPSrc * src, GstSDPMessage ** sdp)
guint size;
gchar *respcont = NULL;
- GST_RTSP_STATE_LOCK (src);
-
restart:
src->need_redirect = FALSE;
@@ -5282,7 +5280,6 @@ cleanup_error:
GST_DEBUG_OBJECT (src, "free connection");
gst_rtsp_conninfo_close (src, &src->conninfo, TRUE);
}
- GST_RTSP_STATE_UNLOCK (src);
gst_rtsp_message_unset (&request);
gst_rtsp_message_unset (&response);
return FALSE;
@@ -5297,6 +5294,8 @@ gst_rtspsrc_open (GstRTSPSrc * src)
src->methods =
GST_RTSP_SETUP | GST_RTSP_PLAY | GST_RTSP_PAUSE | GST_RTSP_TEARDOWN;
+ GST_RTSP_STATE_LOCK (src);
+
if (src->sdp == NULL) {
if (!(res = gst_rtspsrc_retrieve_sdp (src, &src->sdp)))
goto no_sdp;
@@ -5305,17 +5304,21 @@ gst_rtspsrc_open (GstRTSPSrc * src)
if (!(res = gst_rtspsrc_open_from_sdp (src, src->sdp)))
goto open_failed;
+ GST_RTSP_STATE_UNLOCK (src);
+
return res;
/* ERRORS */
no_sdp:
{
GST_WARNING_OBJECT (src, "can't get sdp");
+ GST_RTSP_STATE_UNLOCK (src);
return FALSE;
}
open_failed:
{
GST_WARNING_OBJECT (src, "can't setup streaming from sdp");
+ GST_RTSP_STATE_UNLOCK (src);
return FALSE;
}
}
@@ -5452,7 +5455,6 @@ close:
/* ERRORS */
create_request_failed:
{
- GST_RTSP_STATE_UNLOCK (src);
GST_ELEMENT_ERROR (src, LIBRARY, INIT, (NULL),
("Could not create request."));
ret = FALSE;
@@ -5460,7 +5462,6 @@ create_request_failed:
}
send_error:
{
- GST_RTSP_STATE_UNLOCK (src);
gst_rtsp_message_unset (&request);
GST_ELEMENT_ERROR (src, RESOURCE, WRITE, (NULL),
("Could not send message."));