From 0ce33461c8494113bf401217a58afc78806dfc16 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 10 Sep 2012 12:12:48 +0200 Subject: [PATCH] audiosrc: check for flushing state in provide_clock Only provide a clock when we are not flushing, this means that we have posted a PROVIDE_CLOCK message. We used to check if we were acquired but that doesn't work anymore now that we do the negotiation async in the streaming thread: it's possible that we are still negotiating when the pipeline asks us for a clock. --- gst-libs/gst/audio/gstaudiobasesrc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/audio/gstaudiobasesrc.c b/gst-libs/gst/audio/gstaudiobasesrc.c index 38ca28e..d6c956c 100644 --- a/gst-libs/gst/audio/gstaudiobasesrc.c +++ b/gst-libs/gst/audio/gstaudiobasesrc.c @@ -289,10 +289,11 @@ gst_audio_base_src_provide_clock (GstElement * elem) if (src->ringbuffer == NULL) goto wrong_state; - if (!gst_audio_ring_buffer_is_acquired (src->ringbuffer)) + if (gst_audio_ring_buffer_is_flushing (src->ringbuffer)) goto wrong_state; GST_OBJECT_LOCK (src); + if (!GST_OBJECT_FLAG_IS_SET (src, GST_ELEMENT_FLAG_PROVIDE_CLOCK)) goto clock_disabled; @@ -304,7 +305,7 @@ gst_audio_base_src_provide_clock (GstElement * elem) /* ERRORS */ wrong_state: { - GST_DEBUG_OBJECT (src, "ringbuffer not acquired"); + GST_DEBUG_OBJECT (src, "ringbuffer is flushing"); return NULL; } clock_disabled: -- 2.7.4