summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2017-09-07 12:08:40 -0400
committerThibault Saunier <thibault.saunier@osg.samsung.com>2017-09-19 11:24:22 -0300
commitfaf44ac0e2705f2f4e4c17199642605ae62824eb (patch)
treecc756fbab349cc8644fadea44133a7a025192116
parenta95024545abf6c58d84f5fc0271116d3aaadb9dc (diff)
nlecomposition: Also start task on allocation query
The allocation query may block on the sink when in pause. As a side effect, we may never get a buffer now that tee does forward the allocation query. This would often lead in a pipeline stall. https://bugzilla.gnome.org/show_bug.cgi?id=787405
-rw-r--r--plugins/nle/nlecomposition.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/plugins/nle/nlecomposition.c b/plugins/nle/nlecomposition.c
index cf83313937..61159cb188 100644
--- a/plugins/nle/nlecomposition.c
+++ b/plugins/nle/nlecomposition.c
@@ -195,7 +195,7 @@ struct _NleCompositionPrivate
/* 0 means that we already received the right caps or segment */
gint seqnum_to_restart_task;
- gboolean waiting_for_buffer;
+ gboolean waiting_serialized_query_or_buffer;
gboolean tearing_down_stack;
@@ -1227,8 +1227,9 @@ ghost_event_probe_handler (GstPad * ghostpad G_GNUC_UNUSED,
NleCompositionPrivate *priv = comp->priv;
GstEvent *event;
- if (GST_IS_BUFFER (info->data)) {
- if (priv->waiting_for_buffer) {
+ if (GST_IS_BUFFER (info->data) ||
+ (GST_IS_QUERY (info->data) && GST_QUERY_IS_SERIALIZED (info->data))) {
+ if (priv->waiting_serialized_query_or_buffer) {
GST_INFO_OBJECT (comp, "update_pipeline DONE");
_restart_task (comp);
}
@@ -1806,7 +1807,8 @@ nle_composition_ghost_pad_set_target (NleComposition * comp, GstPad * target)
priv->ghosteventprobe =
gst_pad_add_probe (target,
GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM | GST_PAD_PROBE_TYPE_EVENT_FLUSH |
- GST_PAD_PROBE_TYPE_DATA_DOWNSTREAM,
+ GST_PAD_PROBE_TYPE_DATA_DOWNSTREAM |
+ GST_PAD_PROBE_TYPE_QUERY_DOWNSTREAM,
(GstPadProbeCallback) ghost_event_probe_handler, comp, NULL);
GST_DEBUG_OBJECT (comp, "added event probe %lu", priv->ghosteventprobe);
}
@@ -2254,7 +2256,7 @@ _restart_task (NleComposition * comp)
G_PRIORITY_HIGH);
comp->priv->seqnum_to_restart_task = 0;
- comp->priv->waiting_for_buffer = FALSE;
+ comp->priv->waiting_serialized_query_or_buffer = FALSE;
comp->priv->updating_reason = COMP_UPDATE_STACK_NONE;
GST_OBJECT_LOCK (comp);
@@ -2289,7 +2291,7 @@ _is_ready_to_restart_task (NleComposition * comp, GstEvent * event)
return TRUE;
}
- priv->waiting_for_buffer = TRUE;
+ priv->waiting_serialized_query_or_buffer = TRUE;
return FALSE;
} else if (comp->priv->seqnum_to_restart_task) {