[Bug 661738] New: Deadlock between threads in gstaudiosink and gstringbuffer

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Fri Oct 14 01:08:36 PDT 2011


https://bugzilla.gnome.org/show_bug.cgi?id=661738
  GStreamer | gst-plugins-base | git

           Summary: Deadlock between threads in gstaudiosink and
                    gstringbuffer
    Classification: Platform
           Product: GStreamer
           Version: git
        OS/Version: All
            Status: UNCONFIRMED
          Severity: critical
          Priority: Normal
         Component: gst-plugins-base
        AssignedTo: gstreamer-bugs at lists.freedesktop.org
        ReportedBy: mersad at axis.com
         QAContact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---


When playing (continuously playing over and over again) audio using alsasink,
the thread audioringbuffer_thread_func() in gstaudiosink.c stops at
GST_AUDIORING_BUFFER_WAIT (buf) and in gstringbuffer.c in function
wait_segment() (called by default_commit()) it stops at GST_RING_BUFFER_WAIT
(buf). Just before GST_AUDIORING_BUFFER_WAIT (buf) the wait_segment() has
already put the buffer to state PLAYING by calling gst_ring_buffer_start (buf)
and we need to check this before calling GST_AUDIORING_BUFFER_WAIT (buf).

Suggestion to a solution under the else-statement in
audioringbuffer_thread_func():

+      if (G_UNLIKELY (g_atomic_int_get (&buf->state) ==
+          GST_RING_BUFFER_STATE_STARTED)) {
+        GST_OBJECT_UNLOCK (abuf);
+        continue;
+      }
       GST_DEBUG_OBJECT (sink, "signal wait");
       GST_AUDIORING_BUFFER_SIGNAL (buf);
       GST_DEBUG_OBJECT (sink, "wait for action");
       GST_AUDIORING_BUFFER_WAIT (buf);

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- 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