mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-04 14:38:48 +00:00
inputselector: Hold the selector lock while reading properties of the active pad
This commit is contained in:
parent
5e60a80268
commit
c8ecd6e9eb
1 changed files with 6 additions and 2 deletions
|
@ -560,12 +560,14 @@ done:
|
||||||
/* ERRORS */
|
/* ERRORS */
|
||||||
not_active:
|
not_active:
|
||||||
{
|
{
|
||||||
|
gboolean active_pad_pushed = GST_SELECTOR_PAD_CAST (active_sinkpad)->pushed;
|
||||||
|
|
||||||
GST_INPUT_SELECTOR_UNLOCK (sel);
|
GST_INPUT_SELECTOR_UNLOCK (sel);
|
||||||
|
|
||||||
/* unselected pad, perform fallback alloc or return unlinked when
|
/* unselected pad, perform fallback alloc or return unlinked when
|
||||||
* asked */
|
* asked */
|
||||||
GST_OBJECT_LOCK (selpad);
|
GST_OBJECT_LOCK (selpad);
|
||||||
if (selpad->always_ok || !GST_SELECTOR_PAD_CAST (active_sinkpad)->pushed) {
|
if (selpad->always_ok || !active_pad_pushed) {
|
||||||
GST_DEBUG_OBJECT (pad, "Not selected, performing fallback allocation");
|
GST_DEBUG_OBJECT (pad, "Not selected, performing fallback allocation");
|
||||||
*buf = NULL;
|
*buf = NULL;
|
||||||
result = GST_FLOW_OK;
|
result = GST_FLOW_OK;
|
||||||
|
@ -707,6 +709,8 @@ done:
|
||||||
/* dropped buffers */
|
/* dropped buffers */
|
||||||
ignore:
|
ignore:
|
||||||
{
|
{
|
||||||
|
gboolean active_pad_pushed = GST_SELECTOR_PAD_CAST (active_sinkpad)->pushed;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (pad, "Pad not active, discard buffer %p", buf);
|
GST_DEBUG_OBJECT (pad, "Pad not active, discard buffer %p", buf);
|
||||||
/* when we drop a buffer, we're creating a discont on this pad */
|
/* when we drop a buffer, we're creating a discont on this pad */
|
||||||
selpad->discont = TRUE;
|
selpad->discont = TRUE;
|
||||||
|
@ -715,7 +719,7 @@ ignore:
|
||||||
|
|
||||||
/* figure out what to return upstream */
|
/* figure out what to return upstream */
|
||||||
GST_OBJECT_LOCK (selpad);
|
GST_OBJECT_LOCK (selpad);
|
||||||
if (selpad->always_ok || !GST_SELECTOR_PAD_CAST (active_sinkpad)->pushed)
|
if (selpad->always_ok || !active_pad_pushed)
|
||||||
res = GST_FLOW_OK;
|
res = GST_FLOW_OK;
|
||||||
else
|
else
|
||||||
res = GST_FLOW_NOT_LINKED;
|
res = GST_FLOW_NOT_LINKED;
|
||||||
|
|
Loading…
Reference in a new issue