[Bug 692953] alsasink does not synchronise properly with a live streaming source, yet (timing skew)

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Thu Sep 15 15:23:34 UTC 2016


https://bugzilla.gnome.org/show_bug.cgi?id=692953

--- Comment #233 from GstBlub <gstblub at gmail.com> ---
Review of attachment 277719:
 --> (https://bugzilla.gnome.org/review?bug=692953&attachment=277719)

The deadlock is due to a race condition in
gst_audio_ringbuffer_handle_underrun().  Basically, once the ring buffer thread
gets signalled, it can potentially recover from the xrun and signal
cond_underrun before gst_audio_ringbuffer_handle_underrun() continues to
execute, leading to a deadlock in g_cond_wait().  The solution is to check if
the underrun has been handled already, and only waiting on cond_underrun if it
has not. The function should look like this:

void
gst_audio_ringbuffer_handle_underrun (GstAudioRingBuffer * buf)
{
  GST_OBJECT_LOCK (buf);
  buf->underrun = TRUE;
  GST_AUDIO_RING_BUFFER_SIGNAL (buf);
  if (buf->underrun)
    g_cond_wait (&buf->cond_underrun, GST_OBJECT_GET_LOCK (buf));
  GST_OBJECT_UNLOCK (buf);
}

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list