mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-12 06:42:00 +00:00
gstpad: Don't ignore downstream FlowReturn with IDLE probes
If pushgin downstream returned a non-ok value (like GST_FLOW_WRONG_STATE), we don't want to end up returning a different value (GST_FLOW_OK in this case) if IDLE probes are present.
This commit is contained in:
parent
5a236e5e29
commit
a930f67697
1 changed files with 16 additions and 10 deletions
26
gst/gstpad.c
26
gst/gstpad.c
|
@ -3377,17 +3377,21 @@ probe_hook_marshal (GHook * hook, ProbeMarshall * data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PROBE(pad,mask,data,label) \
|
#define PROBE_FULL(pad,mask,data,label,defaultval) \
|
||||||
G_STMT_START { \
|
G_STMT_START { \
|
||||||
if (G_UNLIKELY (pad->num_probes)) { \
|
if (G_UNLIKELY (pad->num_probes)) { \
|
||||||
ret = do_probe_callbacks (pad, mask, data); \
|
ret = do_probe_callbacks (pad, mask, data, defaultval); \
|
||||||
if (G_UNLIKELY (ret != GST_FLOW_OK)) \
|
if (G_UNLIKELY (ret != defaultval && ret != GST_FLOW_OK)) \
|
||||||
goto label; \
|
goto label; \
|
||||||
} \
|
} \
|
||||||
} G_STMT_END
|
} G_STMT_END
|
||||||
|
|
||||||
|
#define PROBE(pad,mask,data,label) \
|
||||||
|
PROBE_FULL(pad, mask, data, label, GST_FLOW_OK);
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
do_probe_callbacks (GstPad * pad, GstProbeType mask, gpointer type_data)
|
do_probe_callbacks (GstPad * pad, GstProbeType mask, gpointer type_data,
|
||||||
|
GstFlowReturn defaultval)
|
||||||
{
|
{
|
||||||
ProbeMarshall data;
|
ProbeMarshall data;
|
||||||
guint cookie;
|
guint cookie;
|
||||||
|
@ -3444,7 +3448,7 @@ again:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return GST_FLOW_OK;
|
return defaultval;
|
||||||
|
|
||||||
/* ERRORS */
|
/* ERRORS */
|
||||||
flushing:
|
flushing:
|
||||||
|
@ -3459,6 +3463,7 @@ dropped:
|
||||||
}
|
}
|
||||||
passed:
|
passed:
|
||||||
{
|
{
|
||||||
|
/* FIXME : Should we return FLOW_OK or the defaultval ?? */
|
||||||
GST_DEBUG_OBJECT (pad, "data is passed");
|
GST_DEBUG_OBJECT (pad, "data is passed");
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
}
|
}
|
||||||
|
@ -3805,7 +3810,8 @@ gst_pad_push_data (GstPad * pad, GstProbeType type, void *data)
|
||||||
pad->priv->using--;
|
pad->priv->using--;
|
||||||
if (pad->priv->using == 0) {
|
if (pad->priv->using == 0) {
|
||||||
/* pad is not active anymore, trigger idle callbacks */
|
/* pad is not active anymore, trigger idle callbacks */
|
||||||
PROBE (pad, GST_PROBE_TYPE_PUSH | GST_PROBE_TYPE_IDLE, NULL, probe_stopped);
|
PROBE_FULL (pad, GST_PROBE_TYPE_PUSH | GST_PROBE_TYPE_IDLE, NULL,
|
||||||
|
probe_stopped, ret);
|
||||||
}
|
}
|
||||||
GST_OBJECT_UNLOCK (pad);
|
GST_OBJECT_UNLOCK (pad);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue