+2007-01-24 Wim Taymans <wim@fluendo.com>
+
+ * 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.
+
2007-01-24 Wim Taymans <wim@fluendo.com>
* gst/rtp/Makefile.am:
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;
}
}
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 */
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);
}
}
/* 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. */
* 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;
}
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);