urisourcebin: Push EOS if slot is still eos state

linked input of slot can be old input, so urisourcebin should check
eos state to figure out whether it's new one or not.
If not, urisourcebin never ever forwards EOS to downstream at the end
of presentation, because the old input is still there without removal

https://bugzilla.gnome.org/show_bug.cgi?id=777735
This commit is contained in:
Seungha Yang 2017-01-25 19:20:44 +09:00 committed by Edward Hervey
parent 06cf7440ce
commit fc67a689af

View file

@ -1074,6 +1074,7 @@ link_pending_pad_to_output (GstURISourceBin * urisrc, OutputSlotInfo * slot)
slot->is_eos = FALSE; slot->is_eos = FALSE;
BUFFERING_UNLOCK (urisrc); BUFFERING_UNLOCK (urisrc);
res = TRUE; res = TRUE;
slot->is_eos = FALSE;
urisrc->pending_pads = urisrc->pending_pads =
g_list_remove (urisrc->pending_pads, out_info->demux_src_pad); g_list_remove (urisrc->pending_pads, out_info->demux_src_pad);
} else { } else {
@ -1186,6 +1187,7 @@ get_output_slot (GstURISourceBin * urisrc, gboolean do_download,
if (cur_caps == NULL || gst_caps_is_equal (caps, cur_caps)) { if (cur_caps == NULL || gst_caps_is_equal (caps, cur_caps)) {
GST_LOG_OBJECT (urisrc, "Found existing slot %p to link to", slot); GST_LOG_OBJECT (urisrc, "Found existing slot %p to link to", slot);
gst_caps_unref (cur_caps); gst_caps_unref (cur_caps);
slot->is_eos = FALSE;
return slot; return slot;
} }
gst_caps_unref (cur_caps); gst_caps_unref (cur_caps);
@ -1313,8 +1315,17 @@ source_pad_event_probe (GstPad * pad, GstPadProbeInfo * info,
guint32 seqnum; guint32 seqnum;
if (slot->linked_info) { if (slot->linked_info) {
if (slot->is_eos) {
/* linked_info is old input which is stil linked without removal */
GST_DEBUG_OBJECT (pad, "push actual EOS");
seqnum = gst_event_get_seqnum (event);
eos = gst_event_new_eos ();
gst_event_set_seqnum (eos, seqnum);
gst_pad_push_event (slot->srcpad, eos);
} else {
/* Do not clear output slot yet. A new input was /* Do not clear output slot yet. A new input was
* connected. We should just drop this EOS */ * connected. We should just drop this EOS */
}
GST_URI_SOURCE_BIN_UNLOCK (urisrc); GST_URI_SOURCE_BIN_UNLOCK (urisrc);
return GST_PAD_PROBE_DROP; return GST_PAD_PROBE_DROP;
} }