rtpjitterbuffer: Check srcresult before waiting on the condition variable too

It might've been set to FLUSHING between the last check and the waiting,
and in that case we'd be waiting here forever now.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/944>
This commit is contained in:
Sebastian Dröge 2021-04-13 11:30:51 +03:00 committed by GStreamer Marge Bot
parent b289cc6788
commit 52ead086d9

View file

@ -234,6 +234,8 @@ enum
} G_STMT_END
#define JBUF_WAIT_EVENT(priv,label) G_STMT_START { \
if (G_UNLIKELY (priv->srcresult != GST_FLOW_OK)) \
goto label; \
GST_DEBUG ("waiting event"); \
(priv)->waiting_event = TRUE; \
g_cond_wait (&(priv)->jbuf_event, &(priv)->jbuf_lock); \
@ -250,6 +252,8 @@ enum
} G_STMT_END
#define JBUF_WAIT_QUERY(priv,label) G_STMT_START { \
if (G_UNLIKELY (priv->srcresult != GST_FLOW_OK)) \
goto label; \
GST_DEBUG ("waiting query"); \
(priv)->waiting_query = TRUE; \
g_cond_wait (&(priv)->jbuf_query, &(priv)->jbuf_lock); \