summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2007-01-24 16:25:55 +0000
committerWim Taymans <wim.taymans@gmail.com>2007-01-24 16:25:55 +0000
commita6a9207c4298081d2af237edd04e337e5d175e0d (patch)
tree14d973d8b6bb461b7d2eb87ca5c4ea47b3f0fec5 /gst
parentf08317874136d3b9f9026c62fc451b5a8f9366af (diff)
downloadgstreamer-plugins-good-a6a9207c4298081d2af237edd04e337e5d175e0d.tar.gz
gst/rtsp/gstrtspsrc.*: Only unblock the udp pads when we linked and activated them all.
Original commit message from CVS: * gst/rtsp/gstrtspsrc.c: (pad_blocked), (gst_rtspsrc_stream_configure_transport), (gst_rtspsrc_activate_streams), (gst_rtspsrc_loop_udp): * gst/rtsp/gstrtspsrc.h: Only unblock the udp pads when we linked and activated them all. Fixes #395688.
Diffstat (limited to 'gst')
-rw-r--r--gst/rtsp/gstrtspsrc.c30
-rw-r--r--gst/rtsp/gstrtspsrc.h1
2 files changed, 22 insertions, 9 deletions
diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c
index b56265cc8..44d1b05e1 100644
--- a/gst/rtsp/gstrtspsrc.c
+++ b/gst/rtsp/gstrtspsrc.c
@@ -860,17 +860,12 @@ pad_blocked (GstPad * pad, gboolean blocked, GstRTSPSrc * src)
gst_rtspsrc_activate_streams (src);
-unblock:
- /* now unblock and let it stream */
- gst_pad_set_blocked_async (pad, FALSE, (GstPadBlockCallback) pad_unblocked,
- src);
-
return;
was_ok:
{
GST_OBJECT_UNLOCK (src);
- goto unblock;
+ return;
}
}
@@ -994,7 +989,7 @@ gst_rtspsrc_stream_configure_transport (GstRTSPStream * stream,
gst_object_sink (stream->udpsrc[0]);
/* change state */
- gst_element_set_state (stream->udpsrc[0], GST_STATE_PAUSED);
+ gst_element_set_state (stream->udpsrc[0], GST_STATE_READY);
}
/* creating another UDP source */
@@ -1010,7 +1005,7 @@ gst_rtspsrc_stream_configure_transport (GstRTSPStream * stream,
gst_object_ref (stream->udpsrc[0]);
gst_object_sink (stream->udpsrc[0]);
- gst_element_set_state (stream->udpsrc[1], GST_STATE_PAUSED);
+ gst_element_set_state (stream->udpsrc[1], GST_STATE_READY);
}
}
@@ -1033,6 +1028,9 @@ gst_rtspsrc_stream_configure_transport (GstRTSPStream * stream,
/* get output pad of the UDP source. */
outpad = gst_element_get_pad (stream->udpsrc[0], "src");
+ /* save it so we can unblock */
+ stream->blockedpad = outpad;
+
/* configure pad block on the pad. As soon as there is dataflow on the
* UDP source, we know that UDP is not blocked by a firewall and we can
* configure all the streams to let the application autoplug decoders. */
@@ -1139,6 +1137,17 @@ gst_rtspsrc_activate_streams (GstRTSPSrc * src)
* we are done */
gst_element_no_more_pads (GST_ELEMENT_CAST (src));
+ /* unblock all pads */
+ for (walk = src->streams; walk; walk = g_list_next (walk)) {
+ GstRTSPStream *stream = (GstRTSPStream *) walk->data;
+
+ if (stream->blockedpad) {
+ gst_pad_set_blocked_async (stream->blockedpad, FALSE,
+ (GstPadBlockCallback) pad_unblocked, src);
+ stream->blockedpad = NULL;
+ }
+ }
+
return TRUE;
}
@@ -1388,7 +1397,10 @@ gst_rtspsrc_loop_udp (GstRTSPSrc * src)
if (src->loop_cmd == CMD_RECONNECT) {
/* FIXME, when we get here we have to reconnect using tcp */
src->loop_cmd = CMD_WAIT;
- restart = TRUE;
+
+ /* only restart when the pads were not yet activated, else we were
+ * streaming over UDP */
+ restart = src->need_activate;
}
GST_OBJECT_UNLOCK (src);
diff --git a/gst/rtsp/gstrtspsrc.h b/gst/rtsp/gstrtspsrc.h
index fa030b488..8f42895fa 100644
--- a/gst/rtsp/gstrtspsrc.h
+++ b/gst/rtsp/gstrtspsrc.h
@@ -92,6 +92,7 @@ struct _GstRTSPStream {
/* our udp sources */
GstElement *udpsrc[2];
+ GstPad *blockedpad;
/* our udp sink back to the server */
GstElement *udpsink;