From 4dd0b6fe14208f0aab0719c3f5feb20576f47d6d Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Thu, 31 Jul 2014 16:02:06 +0200 Subject: [PATCH] composition: only flush stop after seek was set to READY. --- gnl/gnlcomposition.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/gnl/gnlcomposition.c b/gnl/gnlcomposition.c index 007295c5e5..5ce283a89c 100644 --- a/gnl/gnlcomposition.c +++ b/gnl/gnlcomposition.c @@ -1875,12 +1875,12 @@ _set_current_bin_to_ready (GnlComposition * comp, gboolean flush_downstream) gint probe_id = -1; GstPad *ptarget = NULL; GnlCompositionPrivate *priv = comp->priv; + GstEvent *flush_event; comp->priv->tearing_down_stack = TRUE; if (flush_downstream) { ptarget = gst_ghost_pad_get_target (GST_GHOST_PAD (GNL_OBJECT_SRC (comp))); if (ptarget) { - GstEvent *flush_event; /* Make sure that between the flush_start/flush_stop * and the time we set the current_bin to READY, no @@ -1898,21 +1898,26 @@ _set_current_bin_to_ready (GnlComposition * comp, gboolean flush_downstream) priv->flush_seqnum); gst_pad_push_event (ptarget, flush_event); - flush_event = gst_event_new_flush_stop (TRUE); - gst_event_set_seqnum (flush_event, priv->flush_seqnum); - gst_pad_push_event (ptarget, flush_event); } } gst_element_set_locked_state (priv->current_bin, TRUE); gst_element_set_state (priv->current_bin, GST_STATE_READY); - comp->priv->tearing_down_stack = FALSE; if (ptarget) { + if (flush_downstream) + { + flush_event = gst_event_new_flush_stop (TRUE); + gst_event_set_seqnum (flush_event, priv->flush_seqnum); + gst_pad_push_event (ptarget, flush_event); + } + gst_pad_remove_probe (ptarget, probe_id); gst_object_unref (ptarget); } + + comp->priv->tearing_down_stack = FALSE; } /* Must be called with OBJECTS_LOCK taken */