From b9ddf22340b2d0c76bb0b77a4b8976ed339b1cd8 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 4 Jun 2009 15:19:05 +0200 Subject: rtspsrc: set the right state on rtpbin We need to set the state of gstrtpbin to the same state as our source elements. This fixes fallback to TCP again. --- gst/rtsp/gstrtspsrc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'gst/rtsp') diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c index 82bbfd1d..210e142e 100644 --- a/gst/rtsp/gstrtspsrc.c +++ b/gst/rtsp/gstrtspsrc.c @@ -1903,6 +1903,8 @@ gst_rtspsrc_stream_configure_manager (GstRTSPSrc * src, GstRTSPStream * stream, /* configure the manager */ if (src->session == NULL) { + GstState target; + if (!(src->session = gst_element_factory_make (manager, NULL))) { /* fallback */ if (gst_rtsp_transport_get_manager (transport->trans, &manager, 1) < 0) @@ -1918,7 +1920,11 @@ gst_rtspsrc_stream_configure_manager (GstRTSPSrc * src, GstRTSPStream * stream, /* we manage this element */ gst_bin_add (GST_BIN_CAST (src), src->session); - ret = gst_element_set_state (src->session, GST_STATE_PAUSED); + GST_OBJECT_LOCK (src); + target = GST_STATE_TARGET (src); + GST_OBJECT_UNLOCK (src); + + ret = gst_element_set_state (src->session, target); if (ret == GST_STATE_CHANGE_FAILURE) goto start_session_failure; -- cgit