mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 16:50:47 +00:00
basesrc: fix deadlock
Only go into LIVE_WAIT when the are not live_running and only stop waiting when live_running is TRUE. If we don't loop, we could deadlock when called from outside of basesrc, such as baseaudiosrc. Fixes #635785
This commit is contained in:
parent
17bb26b529
commit
e444ffecf7
1 changed files with 9 additions and 8 deletions
|
@ -490,13 +490,14 @@ gst_base_src_wait_playing (GstBaseSrc * src)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (GST_IS_BASE_SRC (src), GST_FLOW_ERROR);
|
g_return_val_if_fail (GST_IS_BASE_SRC (src), GST_FLOW_ERROR);
|
||||||
|
|
||||||
/* block until the state changes, or we get a flush, or something */
|
while (G_UNLIKELY (!src->live_running)) {
|
||||||
GST_DEBUG_OBJECT (src, "live source waiting for running state");
|
/* block until the state changes, or we get a flush, or something */
|
||||||
GST_LIVE_WAIT (src);
|
GST_DEBUG_OBJECT (src, "live source waiting for running state");
|
||||||
if (src->priv->flushing)
|
GST_LIVE_WAIT (src);
|
||||||
goto flushing;
|
GST_DEBUG_OBJECT (src, "live source unlocked");
|
||||||
GST_DEBUG_OBJECT (src, "live source unlocked");
|
if (src->priv->flushing)
|
||||||
|
goto flushing;
|
||||||
|
}
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
|
|
||||||
/* ERRORS */
|
/* ERRORS */
|
||||||
|
@ -2096,7 +2097,7 @@ gst_base_src_get_range (GstBaseSrc * src, guint64 offset, guint length,
|
||||||
|
|
||||||
again:
|
again:
|
||||||
if (src->is_live) {
|
if (src->is_live) {
|
||||||
while (G_UNLIKELY (!src->live_running)) {
|
if (G_UNLIKELY (!src->live_running)) {
|
||||||
ret = gst_base_src_wait_playing (src);
|
ret = gst_base_src_wait_playing (src);
|
||||||
if (ret != GST_FLOW_OK)
|
if (ret != GST_FLOW_OK)
|
||||||
goto stopped;
|
goto stopped;
|
||||||
|
|
Loading…
Reference in a new issue