mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
pad: Don't consider flushing pads as needing reconfiguration
Renegotiation and reconfiguration will fail because all queries and events won't be accepted by the pad if it's flushing. In the best case this just causes unneeded work and spurious warnings in the debug logs, in the worst case it causes elements to fail completely.
This commit is contained in:
parent
2f78e96299
commit
948a9d2f2b
1 changed files with 16 additions and 6 deletions
22
gst/gstpad.c
22
gst/gstpad.c
|
@ -1400,8 +1400,13 @@ gst_pad_needs_reconfigure (GstPad * pad)
|
||||||
g_return_val_if_fail (GST_IS_PAD (pad), FALSE);
|
g_return_val_if_fail (GST_IS_PAD (pad), FALSE);
|
||||||
|
|
||||||
GST_OBJECT_LOCK (pad);
|
GST_OBJECT_LOCK (pad);
|
||||||
reconfigure = GST_PAD_NEEDS_RECONFIGURE (pad);
|
if (GST_PAD_IS_FLUSHING (pad)) {
|
||||||
GST_DEBUG_OBJECT (pad, "peeking RECONFIGURE flag %d", reconfigure);
|
GST_DEBUG_OBJECT (pad, "pad is flushing");
|
||||||
|
reconfigure = FALSE;
|
||||||
|
} else {
|
||||||
|
reconfigure = GST_PAD_NEEDS_RECONFIGURE (pad);
|
||||||
|
GST_DEBUG_OBJECT (pad, "peeking RECONFIGURE flag %d", reconfigure);
|
||||||
|
}
|
||||||
GST_OBJECT_UNLOCK (pad);
|
GST_OBJECT_UNLOCK (pad);
|
||||||
|
|
||||||
return reconfigure;
|
return reconfigure;
|
||||||
|
@ -1424,10 +1429,15 @@ gst_pad_check_reconfigure (GstPad * pad)
|
||||||
g_return_val_if_fail (GST_IS_PAD (pad), FALSE);
|
g_return_val_if_fail (GST_IS_PAD (pad), FALSE);
|
||||||
|
|
||||||
GST_OBJECT_LOCK (pad);
|
GST_OBJECT_LOCK (pad);
|
||||||
reconfigure = GST_PAD_NEEDS_RECONFIGURE (pad);
|
if (GST_PAD_IS_FLUSHING (pad)) {
|
||||||
if (reconfigure) {
|
GST_DEBUG_OBJECT (pad, "pad is flushing");
|
||||||
GST_DEBUG_OBJECT (pad, "remove RECONFIGURE flag");
|
reconfigure = FALSE;
|
||||||
GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_NEED_RECONFIGURE);
|
} else {
|
||||||
|
reconfigure = GST_PAD_NEEDS_RECONFIGURE (pad);
|
||||||
|
if (reconfigure) {
|
||||||
|
GST_DEBUG_OBJECT (pad, "remove RECONFIGURE flag");
|
||||||
|
GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_NEED_RECONFIGURE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
GST_OBJECT_UNLOCK (pad);
|
GST_OBJECT_UNLOCK (pad);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue