subtitleoverlay: Don't complain when stream-start is the first event.

When blocking the subtitle pad, it's expected that stream-start
is the first event, and that it can precede caps arriving on the
peer pad - in fact the caps can only have arrived on the peer
pad when it was pre-primed with sticky events previously.

Instead, just pass the stream-start and don't block, because
stream-start is sticky anyway.
This commit is contained in:
Jan Schmidt 2016-04-06 21:03:19 +10:00
parent c27df799bf
commit 2dd399356f

View file

@ -1018,10 +1018,17 @@ _pad_blocked_cb (GstPad * pad, GstPadProbeInfo * info, gpointer user_data)
GstCaps *subcaps; GstCaps *subcaps;
GList *l, *factories = NULL; GList *l, *factories = NULL;
if (GST_IS_EVENT (info->data) && !GST_EVENT_IS_SERIALIZED (info->data)) { if (GST_IS_EVENT (info->data)) {
GST_DEBUG_OBJECT (pad, "Letting non-serialized event %s pass", if (!GST_EVENT_IS_SERIALIZED (info->data)) {
GST_EVENT_TYPE_NAME (info->data)); GST_DEBUG_OBJECT (pad, "Letting non-serialized event %s pass",
return GST_PAD_PROBE_PASS; GST_EVENT_TYPE_NAME (info->data));
return GST_PAD_PROBE_PASS;
}
if (GST_EVENT_TYPE (info->data) == GST_EVENT_STREAM_START) {
GST_DEBUG_OBJECT (pad, "Letting event %s pass",
GST_EVENT_TYPE_NAME (info->data));
return GST_PAD_PROBE_PASS;
}
} }
GST_DEBUG_OBJECT (pad, "Pad blocked"); GST_DEBUG_OBJECT (pad, "Pad blocked");
@ -1059,7 +1066,7 @@ _pad_blocked_cb (GstPad * pad, GstPadProbeInfo * info, gpointer user_data)
/* If there are no subcaps but the subtitle sink is blocked upstream /* If there are no subcaps but the subtitle sink is blocked upstream
* must behave wrong as there are no fixed caps set for the first * must behave wrong as there are no fixed caps set for the first
* buffer or in-order event */ * buffer or in-order event after stream-start */
if (G_UNLIKELY (!subcaps && self->subtitle_sink_blocked)) { if (G_UNLIKELY (!subcaps && self->subtitle_sink_blocked)) {
GST_ELEMENT_WARNING (self, CORE, NEGOTIATION, (NULL), GST_ELEMENT_WARNING (self, CORE, NEGOTIATION, (NULL),
("Subtitle sink is blocked but we have no subtitle caps")); ("Subtitle sink is blocked but we have no subtitle caps"));