From 92105a17a506787ef595f4e4a0ffe3ad8fd1261d Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Tue, 8 Jul 2014 22:53:57 +0200 Subject: [PATCH] composition: Handle the case were we get an EOS right after a segment Co-Authored by: Mathieu Duponchelle --- gnl/gnlcomposition.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gnl/gnlcomposition.c b/gnl/gnlcomposition.c index 03be69bdc9..c6822293c6 100644 --- a/gnl/gnlcomposition.c +++ b/gnl/gnlcomposition.c @@ -239,6 +239,8 @@ _gnl_composition_add_entry (GnlComposition * comp, GnlObject * object); static gboolean _gnl_composition_remove_entry (GnlComposition * comp, GnlObject * object); static void _deactivate_stack (GnlComposition * comp); +static GstPadProbeReturn _add_emit_commited_and_restart_task (GnlComposition * + comp); /* COMP_REAL_START: actual position to start current playback at. */ @@ -1213,6 +1215,14 @@ ghost_event_probe_handler (GstPad * ghostpad G_GNUC_UNUSED, GST_ERROR_OBJECT (comp, "Got EOS, last EOS seqnum id : %i current " "seq num is: %i", comp->priv->real_eos_seqnum, seqnum); + if (priv->commited_probeid && comp->priv->awaited_segment_seqnum == 0) { + + GST_INFO_OBJECT (comp, "We got an EOS right after seeing the right" + " segment, restarting task"); + gst_pad_remove_probe (GNL_OBJECT_SRC (comp), priv->commited_probeid); + _add_emit_commited_and_restart_task (comp); + } + if (g_atomic_int_compare_and_exchange (&comp->priv->real_eos_seqnum, seqnum, 1)) {