GstQuery * query);
static gboolean gst_base_src_set_flushing (GstBaseSrc * basesrc,
- gboolean flushing, gboolean live_play, gboolean unlock, gboolean * playing);
+ gboolean flushing, gboolean live_play, gboolean * playing);
static gboolean gst_base_src_start (GstBaseSrc * basesrc);
static gboolean gst_base_src_stop (GstBaseSrc * basesrc);
* when we reach the segment.stop we have to post a segment.done
* instead of EOS when doing a segment seek.
*/
-/* FIXME (0.11), we have the unlock gboolean here because most current
- * implementations (fdsrc, -base/gst/tcp/, ...) unconditionally unlock, even when
- * the streaming thread isn't running, resulting in bogus unlocks later when it
- * starts. This is fixed by adding unlock_stop, but we should still avoid unlocking
- * unnecessarily for backwards compatibility. Ergo, the unlock variable stays
- * until 0.11
- */
static gboolean
-gst_base_src_perform_seek (GstBaseSrc * src, GstEvent * event, gboolean unlock)
+gst_base_src_perform_seek (GstBaseSrc * src, GstEvent * event)
{
gboolean res = TRUE, tres;
gdouble rate;
gst_pad_pause_task (src->srcpad);
/* unblock streaming thread. */
- gst_base_src_set_flushing (src, TRUE, FALSE, unlock, &playing);
+ gst_base_src_set_flushing (src, TRUE, FALSE, &playing);
/* grab streaming lock, this should eventually be possible, either
* because the task is paused, our streaming thread stopped
GST_DEBUG_OBJECT (src, "seek with seqnum %" G_GUINT32_FORMAT, seqnum);
}
- gst_base_src_set_flushing (src, FALSE, playing, unlock, NULL);
+ gst_base_src_set_flushing (src, FALSE, playing, NULL);
/* If we configured the seeksegment above, don't overwrite it now. Otherwise
* copy the current segment info into the temp segment that we can actually
if (started) {
GST_DEBUG_OBJECT (src, "performing seek");
/* when we are running in push mode, we can execute the
- * seek right now, we need to unlock. */
- result = gst_base_src_perform_seek (src, event, TRUE);
+ * seek right now. */
+ result = gst_base_src_perform_seek (src, event);
} else {
GstEvent **event_p;
if (!gst_base_src_seekable (src))
goto not_seekable;
- result = gst_base_src_perform_seek (src, event, TRUE);
+ result = gst_base_src_perform_seek (src, event);
break;
case GST_EVENT_FLUSH_START:
/* cancel any blocking getrange, is normally called
* when in pull mode. */
- result = gst_base_src_set_flushing (src, TRUE, FALSE, TRUE, NULL);
+ result = gst_base_src_set_flushing (src, TRUE, FALSE, NULL);
break;
case GST_EVENT_FLUSH_STOP:
- result = gst_base_src_set_flushing (src, FALSE, TRUE, TRUE, NULL);
+ result = gst_base_src_set_flushing (src, FALSE, TRUE, NULL);
break;
case GST_EVENT_QOS:
{
/* stop flushing now but for live sources, still block in the LIVE lock when
* we are not yet PLAYING */
- gst_base_src_set_flushing (basesrc, FALSE, FALSE, FALSE, NULL);
+ gst_base_src_set_flushing (basesrc, FALSE, FALSE, NULL);
gst_pad_mark_reconfigure (GST_BASE_SRC_PAD (basesrc));
basesrc->pending_seek = NULL;
GST_OBJECT_UNLOCK (basesrc);
- /* no need to unlock anything, the task is certainly
- * not running here. The perform seek code will start the task when
- * finished. */
- if (G_UNLIKELY (!gst_base_src_perform_seek (basesrc, event, FALSE)))
+ /* The perform seek code will start the task when finished. */
+ if (G_UNLIKELY (!gst_base_src_perform_seek (basesrc, event)))
goto seek_failed;
if (event)
{
GST_PAD_STREAM_UNLOCK (basesrc->srcpad);
GST_ERROR_OBJECT (basesrc, "Failed to perform initial seek");
- gst_base_src_set_flushing (basesrc, TRUE, FALSE, TRUE, NULL);
+ gst_base_src_set_flushing (basesrc, TRUE, FALSE, NULL);
if (event)
gst_event_unref (event);
ret = GST_FLOW_ERROR;
no_get_range:
{
GST_PAD_STREAM_UNLOCK (basesrc->srcpad);
- gst_base_src_set_flushing (basesrc, TRUE, FALSE, TRUE, NULL);
+ gst_base_src_set_flushing (basesrc, TRUE, FALSE, NULL);
GST_ERROR_OBJECT (basesrc, "Cannot operate in pull mode, stopping");
ret = GST_FLOW_ERROR;
goto error;
GST_DEBUG_OBJECT (basesrc, "stopping source");
/* flush all */
- gst_base_src_set_flushing (basesrc, TRUE, FALSE, TRUE, NULL);
+ gst_base_src_set_flushing (basesrc, TRUE, FALSE, NULL);
/* stop the task */
gst_pad_stop_task (basesrc->srcpad);
*/
static gboolean
gst_base_src_set_flushing (GstBaseSrc * basesrc,
- gboolean flushing, gboolean live_play, gboolean unlock, gboolean * playing)
+ gboolean flushing, gboolean live_play, gboolean * playing)
{
GstBaseSrcClass *bclass;
bclass = GST_BASE_SRC_GET_CLASS (basesrc);
- if (flushing && unlock) {
+ if (flushing) {
gst_base_src_activate_pool (basesrc, FALSE);
/* unlock any subclasses, we need to do this before grabbing the
* LIVE_LOCK since we hold this lock before going into ::create. We pass an
gst_base_src_activate_pool (basesrc, TRUE);
- /* When unlocking drop all delayed events */
- if (unlock) {
- GST_OBJECT_LOCK (basesrc);
- if (basesrc->priv->pending_events) {
- g_list_foreach (basesrc->priv->pending_events, (GFunc) gst_event_unref,
- NULL);
- g_list_free (basesrc->priv->pending_events);
- basesrc->priv->pending_events = NULL;
- g_atomic_int_set (&basesrc->priv->have_events, FALSE);
- }
- GST_OBJECT_UNLOCK (basesrc);
+ /* Drop all delayed events */
+ GST_OBJECT_LOCK (basesrc);
+ if (basesrc->priv->pending_events) {
+ g_list_foreach (basesrc->priv->pending_events, (GFunc) gst_event_unref,
+ NULL);
+ g_list_free (basesrc->priv->pending_events);
+ basesrc->priv->pending_events = NULL;
+ g_atomic_int_set (&basesrc->priv->have_events, FALSE);
}
+ GST_OBJECT_UNLOCK (basesrc);
}
GST_LIVE_SIGNAL (basesrc);
GST_LIVE_UNLOCK (basesrc);