mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-18 04:05:34 +00:00
pad: Recheck sticky events after non-blocking buffer probes and blocking event probes
Without the former, event changes (e.g. setting a pad offset) does not take effect for the current buffer but only for the next one. Without the latter, non-blocking event probes would not see any updated events yet.
This commit is contained in:
parent
a79503a433
commit
087eca8827
1 changed files with 15 additions and 0 deletions
15
gst/gstpad.c
15
gst/gstpad.c
|
@ -4446,6 +4446,10 @@ gst_pad_push_data (GstPad * pad, GstPadProbeType type, void *data)
|
|||
/* do post-blocking probes */
|
||||
PROBE_HANDLE (pad, type, data, probe_stopped, probe_handled);
|
||||
|
||||
/* recheck sticky events because the probe might have cause a relink */
|
||||
if (G_UNLIKELY ((ret = check_sticky (pad, NULL))) != GST_FLOW_OK)
|
||||
goto events_error;
|
||||
|
||||
if (G_UNLIKELY ((peer = GST_PAD_PEER (pad)) == NULL))
|
||||
goto not_linked;
|
||||
|
||||
|
@ -5230,6 +5234,17 @@ gst_pad_push_event_unchecked (GstPad * pad, GstEvent * event,
|
|||
}
|
||||
PROBE_PUSH (pad, type | GST_PAD_PROBE_TYPE_PUSH |
|
||||
GST_PAD_PROBE_TYPE_BLOCK, event, probe_stopped);
|
||||
/* recheck sticky events because the probe might have cause a relink */
|
||||
if (GST_PAD_HAS_PENDING_EVENTS (pad) && GST_PAD_IS_SRC (pad)
|
||||
&& (GST_EVENT_IS_SERIALIZED (event)
|
||||
|| GST_EVENT_IS_STICKY (event))) {
|
||||
PushStickyData data = { GST_FLOW_OK, FALSE, event };
|
||||
GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_PENDING_EVENTS);
|
||||
|
||||
/* Push all sticky events before our current one
|
||||
* that have changed */
|
||||
events_foreach (pad, sticky_changed, &data);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue