diff options
author | Mark Nauwelaerts <mnauw@users.sourceforge.net> | 2015-01-08 21:20:14 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2015-06-10 19:27:23 +0100 |
commit | ae42176f346594d35ded188415b50be8e4bc270a (patch) | |
tree | a6efe185cee2167fed9a867c087b1900c5cabdce | |
parent | 8a29abe8f2c58606df3232deae6993749c12477d (diff) | |
download | gstreamer-plugins-base-1.4.tar.gz |
audioringbuffer: start ringbuffer if needed upon commit1.4
... to provide for a running clock.
-rw-r--r-- | gst-libs/gst/audio/gstaudioringbuffer.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gst-libs/gst/audio/gstaudioringbuffer.c b/gst-libs/gst/audio/gstaudioringbuffer.c index 7f4b17b01..1fa711ef8 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; |