From: Mark Nauwelaerts Date: Thu, 8 Jan 2015 20:20:14 +0000 (+0100) Subject: audioringbuffer: start ringbuffer if needed upon commit X-Git-Tag: 1.19.3~511^2~3997 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=13ee94ef1091f8a8a90dbd395b39876c26c5188e;p=platform%2Fupstream%2Fgstreamer.git audioringbuffer: start ringbuffer if needed upon commit ... to provide for a running clock. --- diff --git a/gst-libs/gst/audio/gstaudioringbuffer.c b/gst-libs/gst/audio/gstaudioringbuffer.c index 6624d0dd6b..4220e9d496 100644 --- a/gst-libs/gst/audio/gstaudioringbuffer.c +++ b/gst-libs/gst/audio/gstaudioringbuffer.c @@ -1462,6 +1462,18 @@ default_commit (GstAudioRingBuffer * buf, guint64 * sample, g_return_val_if_fail (buf->memory != NULL, -1); g_return_val_if_fail (data != NULL, -1); + /* writing stuff now, ensure running clock */ + if (G_UNLIKELY (g_atomic_int_get (&buf->state) != + GST_AUDIO_RING_BUFFER_STATE_STARTED)) { + /* see if we are allowed to start it */ + if (G_UNLIKELY (g_atomic_int_get (&buf->may_start) == FALSE)) { + GST_DEBUG_OBJECT (buf, "not allowed to start"); + } else { + GST_DEBUG_OBJECT (buf, "start!"); + gst_audio_ring_buffer_start (buf); + } + } + need_reorder = buf->need_reorder; channels = buf->spec.info.channels;