mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-21 15:56:42 +00:00
pad: Always return errors for EOS events immediately
For non-EOS events things will error out later during data flow but after EOS events no data flow is happening. See bug #677340.
This commit is contained in:
parent
991ac561e1
commit
5a8c901507
1 changed files with 14 additions and 18 deletions
28
gst/gstpad.c
28
gst/gstpad.c
|
@ -3185,8 +3185,9 @@ push_sticky (GstPad * pad, PadEvent * ev, gpointer user_data)
|
|||
break;
|
||||
case GST_FLOW_NOT_LINKED:
|
||||
/* not linked is not a problem, we are sticky so the event will be
|
||||
* sent later */
|
||||
* sent later but only for non-EOS events */
|
||||
GST_DEBUG_OBJECT (pad, "pad was not linked");
|
||||
if (GST_EVENT_TYPE (ev) != GST_FLOW_EOS)
|
||||
data->ret = GST_FLOW_OK;
|
||||
/* fallthrough */
|
||||
default:
|
||||
|
@ -3222,22 +3223,11 @@ check_sticky (GstPad * pad)
|
|||
* event failed.
|
||||
*/
|
||||
if (data.ret != GST_FLOW_OK && !data.was_eos) {
|
||||
GArray *events = pad->priv->events;
|
||||
gint i, len;
|
||||
PadEvent *ev = find_event_by_type (pad, GST_EVENT_EOS, 0);
|
||||
|
||||
len = events->len;
|
||||
for (i = 0; i < len; i++) {
|
||||
PadEvent *ev = &g_array_index (events, PadEvent, i);
|
||||
|
||||
if (G_UNLIKELY (ev->event == NULL) || ev->received)
|
||||
continue;
|
||||
|
||||
if (GST_EVENT_TYPE (ev->event) == GST_EVENT_EOS) {
|
||||
gst_pad_push_event_unchecked (pad, gst_event_ref (ev->event),
|
||||
if (ev && !ev->received) {
|
||||
data.ret = gst_pad_push_event_unchecked (pad, gst_event_ref (ev->event),
|
||||
GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4491,8 +4481,14 @@ gst_pad_push_event (GstPad * pad, GstEvent * event)
|
|||
/* other events are pushed right away */
|
||||
res = (gst_pad_push_event_unchecked (pad, event, type) == GST_FLOW_OK);
|
||||
} else {
|
||||
gst_event_unref (event);
|
||||
/* Errors in sticky event pushing are no problem and ignored here
|
||||
* as they will cause more meaningful errors during data flow.
|
||||
* For EOS events, that are not followed by data flow, we still
|
||||
* return FALSE here though.
|
||||
*/
|
||||
if (GST_EVENT_TYPE (event) != GST_EVENT_EOS)
|
||||
res = TRUE;
|
||||
gst_event_unref (event);
|
||||
}
|
||||
GST_OBJECT_UNLOCK (pad);
|
||||
|
||||
|
|
Loading…
Reference in a new issue