omx: Fix deadlock between ending a flush and the event handler
authorArun Raghavan <arun.raghavan@collabora.co.uk>
Wed, 25 Apr 2012 11:05:40 +0000 (16:35 +0530)
committerArun Raghavan <arun.raghavan@collabora.co.uk>
Thu, 26 Apr 2012 04:12:50 +0000 (09:42 +0530)
gst_omx_port_set_flushing() calls OMX_FillThisBuffer at the end of a flush
without releasing the port lock, and this can cause a deadlock with the
EventHandler. This patches fixes this by dropping the lock for the duration of
the fill buffer call.

omx/gstomx.c

index 426e9531065a3cb2aa1368399b019e9ada9d0f8a..d7cf5a002599bbc2065892067c6fe91ea383f7ef 100644 (file)
@@ -1220,7 +1220,9 @@ gst_omx_port_set_flushing (GstOMXPort * port, gboolean flush)
          * valid anymore after the buffer was consumed
          */
         buf->omx_buf->nFlags = 0;
+        g_mutex_unlock (port->port_lock);
         err = OMX_FillThisBuffer (comp->handle, buf->omx_buf);
+        g_mutex_lock (port->port_lock);
         if (err != OMX_ErrorNone) {
           GST_ERROR_OBJECT (comp->parent,
               "Failed to pass buffer %p (%p) to port %u: %s (0x%08x)", buf,