queue2: Fix deadlock when deactivate is called in pull mode

check is flush was called before waiting on condition

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2967>
This commit is contained in:
Paweł Stawicki 2022-08-31 18:08:08 +02:00 committed by GStreamer Marge Bot
parent 03a24de4cb
commit ccef26908e

View file

@ -218,6 +218,9 @@ static GParamSpec *obj_props[PROP_LAST] = { NULL, };
} G_STMT_END } G_STMT_END
#define GST_QUEUE2_WAIT_DEL_CHECK(q, res, label) G_STMT_START { \ #define GST_QUEUE2_WAIT_DEL_CHECK(q, res, label) G_STMT_START { \
if (res != GST_FLOW_OK) { \
goto label; \
} \
STATUS (queue, q->sinkpad, "wait for DEL"); \ STATUS (queue, q->sinkpad, "wait for DEL"); \
q->waiting_del = TRUE; \ q->waiting_del = TRUE; \
g_cond_wait (&q->item_del, &queue->qlock); \ g_cond_wait (&q->item_del, &queue->qlock); \
@ -230,6 +233,9 @@ static GParamSpec *obj_props[PROP_LAST] = { NULL, };
} G_STMT_END } G_STMT_END
#define GST_QUEUE2_WAIT_ADD_CHECK(q, res, label) G_STMT_START { \ #define GST_QUEUE2_WAIT_ADD_CHECK(q, res, label) G_STMT_START { \
if (res != GST_FLOW_OK) { \
goto label; \
} \
STATUS (queue, q->srcpad, "wait for ADD"); \ STATUS (queue, q->srcpad, "wait for ADD"); \
q->waiting_add = TRUE; \ q->waiting_add = TRUE; \
g_cond_wait (&q->item_add, &q->qlock); \ g_cond_wait (&q->item_add, &q->qlock); \