basesrc: Leave the loop function faster if we're flushing

Especially don't even try to send stream-start event or try
to negotiate.

https://bugzilla.gnome.org/show_bug.cgi?id=704100
This commit is contained in:
Sebastian Dröge 2013-07-15 11:32:10 +02:00
parent 717ad20912
commit d60c2c2864

View file

@ -2573,8 +2573,20 @@ gst_base_src_loop (GstPad * pad)
src = GST_BASE_SRC (GST_OBJECT_PARENT (pad));
/* Just leave immediately if we're flushing */
GST_LIVE_LOCK (src);
if (G_UNLIKELY (src->priv->flushing || GST_PAD_IS_FLUSHING (pad)))
goto flushing;
GST_LIVE_UNLOCK (src);
gst_base_src_send_stream_start (src);
/* The stream-start event could've caused something to flush us */
GST_LIVE_LOCK (src);
if (G_UNLIKELY (src->priv->flushing || GST_PAD_IS_FLUSHING (pad)))
goto flushing;
GST_LIVE_UNLOCK (src);
/* check if we need to renegotiate */
if (gst_pad_check_reconfigure (pad)) {
if (!gst_base_src_negotiate (src)) {
@ -2588,7 +2600,7 @@ gst_base_src_loop (GstPad * pad)
GST_LIVE_LOCK (src);
if (G_UNLIKELY (src->priv->flushing))
if (G_UNLIKELY (src->priv->flushing || GST_PAD_IS_FLUSHING (pad)))
goto flushing;
blocksize = src->blocksize;