camerabin: improve image done signal emission
authorLasse Laukkanen <ext-lasse.2.laukkanen@nokia.com>
Fri, 11 Sep 2009 06:38:51 +0000 (09:38 +0300)
committerStefan Kost <ensonic@users.sf.net>
Mon, 12 Apr 2010 12:15:22 +0000 (15:15 +0300)
Use g_idle_add_full() with G_PRIORITY_HIGH to emit image done signal,
g_idle_add() is more likely to starve with higher priority events.

gst/camerabin/gstcamerabin.c

index 61ac7f8..55ed1a3 100644 (file)
@@ -3246,7 +3246,10 @@ gst_camerabin_handle_message_func (GstBin * bin, GstMessage * msg)
       } else if (GST_MESSAGE_SRC (msg) == GST_OBJECT (camera->imgbin)) {
         /* Image eos */
         GST_DEBUG_OBJECT (camera, "got image eos message");
-        g_idle_add (gst_camerabin_imgbin_finished, camera);
+        /* Calling callback directly will deadlock in
+           imagebin state change functions */
+        g_idle_add_full (G_PRIORITY_HIGH, gst_camerabin_imgbin_finished, camera,
+            NULL);
       }
       break;
     case GST_MESSAGE_ERROR: