From 5c479aa3a4f7a277b723a3d7608d80ee09bcff95 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 10 Jan 2011 13:18:16 +0100 Subject: [PATCH] basesrc: make sure we wait and release the live lock Make sure we release the live lock and wait in all cases when we need to wait for the playing or flushing state change. Fixes #635785 --- libs/gst/base/gstbasesrc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/gst/base/gstbasesrc.c b/libs/gst/base/gstbasesrc.c index 92391882fc..c4502236b6 100644 --- a/libs/gst/base/gstbasesrc.c +++ b/libs/gst/base/gstbasesrc.c @@ -491,14 +491,15 @@ gst_base_src_wait_playing (GstBaseSrc * src) { g_return_val_if_fail (GST_IS_BASE_SRC (src), GST_FLOW_ERROR); - while (G_UNLIKELY (!src->live_running)) { + do { /* block until the state changes, or we get a flush, or something */ GST_DEBUG_OBJECT (src, "live source waiting for running state"); GST_LIVE_WAIT (src); GST_DEBUG_OBJECT (src, "live source unlocked"); if (src->priv->flushing) goto flushing; - } + } while (G_UNLIKELY (!src->live_running)); + return GST_FLOW_OK; /* ERRORS */