+2005-06-29 Wim Taymans <wim@fluendo.com>
+
+ * gst/base/gstbasesink.c: (gst_base_sink_handle_object):
+ We are actually prerolling before commiting the state
+ change.
+
2005-06-29 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* docs/manual/advanced-clocks.xml:
}
/* we are prerolling */
GST_DEBUG ("finish preroll %p >", basesink);
+ basesink->have_preroll = TRUE;
GST_PREROLL_UNLOCK (pad);
/* have to release STREAM_LOCK as we cannot take the STATE_LOCK
if (t > 0)
GST_STREAM_LOCK_FULL (pad, t);
+ /* and wait if needed */
+ GST_PREROLL_LOCK (pad);
+
GST_LOCK (pad);
if (G_UNLIKELY (GST_PAD_IS_FLUSHING (pad)))
goto flushing;
GST_UNLOCK (pad);
- /* and wait if needed */
- GST_PREROLL_LOCK (pad);
/* it is possible that the application set the state to PLAYING
* now in which case we don't need to block anymore. */
if (!basesink->need_preroll)
/* block until the state changes, or we get a flush, or something */
GST_DEBUG ("element %s waiting to finish preroll",
GST_ELEMENT_NAME (basesink));
- basesink->have_preroll = TRUE;
GST_PREROLL_WAIT (pad);
GST_DEBUG ("done preroll");
basesink->have_preroll = FALSE;
}
- GST_PREROLL_UNLOCK (pad);
-
GST_LOCK (pad);
if (G_UNLIKELY (GST_PAD_IS_FLUSHING (pad)))
goto flushing;
GST_UNLOCK (pad);
+ GST_PREROLL_UNLOCK (pad);
+
return GST_FLOW_OK;
no_preroll:
GST_DEBUG ("no preroll needed");
/* maybe it was another sink that blocked in preroll, need to check for
buffers to drain */
+ basesink->have_preroll = FALSE;
ret = gst_base_sink_preroll_queue_empty (basesink, pad);
GST_PREROLL_UNLOCK (pad);
flushing:
{
GST_UNLOCK (pad);
+ basesink->have_preroll = FALSE;
+ GST_PREROLL_UNLOCK (pad);
GST_DEBUG ("pad is flushing");
return GST_FLOW_WRONG_STATE;
}
}
/* we are prerolling */
GST_DEBUG ("finish preroll %p >", basesink);
+ basesink->have_preroll = TRUE;
GST_PREROLL_UNLOCK (pad);
/* have to release STREAM_LOCK as we cannot take the STATE_LOCK
if (t > 0)
GST_STREAM_LOCK_FULL (pad, t);
+ /* and wait if needed */
+ GST_PREROLL_LOCK (pad);
+
GST_LOCK (pad);
if (G_UNLIKELY (GST_PAD_IS_FLUSHING (pad)))
goto flushing;
GST_UNLOCK (pad);
- /* and wait if needed */
- GST_PREROLL_LOCK (pad);
/* it is possible that the application set the state to PLAYING
* now in which case we don't need to block anymore. */
if (!basesink->need_preroll)
/* block until the state changes, or we get a flush, or something */
GST_DEBUG ("element %s waiting to finish preroll",
GST_ELEMENT_NAME (basesink));
- basesink->have_preroll = TRUE;
GST_PREROLL_WAIT (pad);
GST_DEBUG ("done preroll");
basesink->have_preroll = FALSE;
}
- GST_PREROLL_UNLOCK (pad);
-
GST_LOCK (pad);
if (G_UNLIKELY (GST_PAD_IS_FLUSHING (pad)))
goto flushing;
GST_UNLOCK (pad);
+ GST_PREROLL_UNLOCK (pad);
+
return GST_FLOW_OK;
no_preroll:
GST_DEBUG ("no preroll needed");
/* maybe it was another sink that blocked in preroll, need to check for
buffers to drain */
+ basesink->have_preroll = FALSE;
ret = gst_base_sink_preroll_queue_empty (basesink, pad);
GST_PREROLL_UNLOCK (pad);
flushing:
{
GST_UNLOCK (pad);
+ basesink->have_preroll = FALSE;
+ GST_PREROLL_UNLOCK (pad);
GST_DEBUG ("pad is flushing");
return GST_FLOW_WRONG_STATE;
}