mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-17 21:06:17 +00:00
pad: Warn if data flow happens before stream-start or segment event
This commit is contained in:
parent
430285b5c8
commit
8bedcf450f
1 changed files with 22 additions and 0 deletions
22
gst/gstpad.c
22
gst/gstpad.c
|
@ -3670,6 +3670,17 @@ gst_pad_chain_data_unchecked (GstPad * pad, GstPadProbeType type, void *data)
|
|||
if (G_UNLIKELY (GST_PAD_MODE (pad) != GST_PAD_MODE_PUSH))
|
||||
goto wrong_mode;
|
||||
|
||||
if (!find_event_by_type (pad, GST_EVENT_STREAM_START, 0)) {
|
||||
g_warning (G_STRLOC
|
||||
":%s:<%s:%s> Got data flow before stream-start event",
|
||||
G_STRFUNC, GST_DEBUG_PAD_NAME (pad));
|
||||
}
|
||||
if (!find_event_by_type (pad, GST_EVENT_SEGMENT, 0)) {
|
||||
g_warning (G_STRLOC
|
||||
":%s:<%s:%s> Got data flow before segment event",
|
||||
G_STRFUNC, GST_DEBUG_PAD_NAME (pad));
|
||||
}
|
||||
|
||||
PROBE_PUSH (pad, type | GST_PAD_PROBE_TYPE_BLOCK, data, probe_stopped);
|
||||
|
||||
PROBE_PUSH (pad, type, data, probe_stopped);
|
||||
|
@ -3888,6 +3899,17 @@ gst_pad_push_data (GstPad * pad, GstPadProbeType type, void *data)
|
|||
if (G_UNLIKELY (GST_PAD_MODE (pad) != GST_PAD_MODE_PUSH))
|
||||
goto wrong_mode;
|
||||
|
||||
if (!find_event_by_type (pad, GST_EVENT_STREAM_START, 0)) {
|
||||
g_warning (G_STRLOC
|
||||
":%s:<%s:%s> Got data flow before stream-start event",
|
||||
G_STRFUNC, GST_DEBUG_PAD_NAME (pad));
|
||||
}
|
||||
if (!find_event_by_type (pad, GST_EVENT_SEGMENT, 0)) {
|
||||
g_warning (G_STRLOC
|
||||
":%s:<%s:%s> Got data flow before segment event",
|
||||
G_STRFUNC, GST_DEBUG_PAD_NAME (pad));
|
||||
}
|
||||
|
||||
if (G_UNLIKELY ((ret = check_sticky (pad, NULL))) != GST_FLOW_OK)
|
||||
goto events_error;
|
||||
|
||||
|
|
Loading…
Reference in a new issue