From 2dd399356f9e7f4ca30fab8dd65886fc1120d4b7 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Wed, 6 Apr 2016 21:03:19 +1000 Subject: [PATCH] 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. --- gst/playback/gstsubtitleoverlay.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/gst/playback/gstsubtitleoverlay.c b/gst/playback/gstsubtitleoverlay.c index 5223c8712d..d3e02873ea 100644 --- a/gst/playback/gstsubtitleoverlay.c +++ b/gst/playback/gstsubtitleoverlay.c @@ -1018,10 +1018,17 @@ _pad_blocked_cb (GstPad * pad, GstPadProbeInfo * info, gpointer user_data) GstCaps *subcaps; GList *l, *factories = NULL; - if (GST_IS_EVENT (info->data) && !GST_EVENT_IS_SERIALIZED (info->data)) { - GST_DEBUG_OBJECT (pad, "Letting non-serialized event %s pass", - GST_EVENT_TYPE_NAME (info->data)); - return GST_PAD_PROBE_PASS; + if (GST_IS_EVENT (info->data)) { + if (!GST_EVENT_IS_SERIALIZED (info->data)) { + GST_DEBUG_OBJECT (pad, "Letting non-serialized event %s 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"); @@ -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 * 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)) { GST_ELEMENT_WARNING (self, CORE, NEGOTIATION, (NULL), ("Subtitle sink is blocked but we have no subtitle caps"));